Decimal

Decimal is the name for our common base-ten numeral system

Ieee

IEEE, pronounced "Eye-triple-E," stands for the Institute of Electrical and Electronics Engineers.

Useful precision 64bit

Example |
---|

"Decimal types libraries are fantastic for financial applications because we re used to dealing with the style of rounding required in financial stuff but there is the cost that they tend to be from question Javascript: Precision strange behavior |

"The maximum representable value with ieee 754-2008 binary32 is so the base 2 log of a number stored in binary 32 is from question Convert number to their log2 "The third line displays the data with the maximum useful precision - an ieee 754 64bit floating-point number has slightly from question How to print a double with full precision on iOS? |

"Many decimal numbers cannot be represented exactly in this representation;so the compiler uses the nearest available binary ieee from question Why does this cast change the result when even VS says it is redundant? |

"Most decimal from question Different rounding results in terms of floating number ending with 5 in C++ |

Others

Example |
---|

Double has its ieee floating point definition which is also much from question C# Double.ToString() performance issue |

Decimal cannot use the fpu;you get best performance with float or real which map to a standard ieee from question TSQL: Which real number type results in faster comparisons |

Above number.max_safe_integer for example the precision is from question How to convert a number to float with 8 point decimal places in javascript |

Note using parsefloat ieee 754 double precision floating-point means you have a maximum of 52 bits of precision which is a bit from question How to calculate logarithm with base N for big integer? |

If an approximate result is good enough and there are lots of calculations where it is you can use double but be aware that it s a binary floating point number and accurate rounding to decimal from question Setting precision for double in java |