0

Recently, I am fully confused by how floating point was represented. I konw that from wiki(https://en.wikipedia.org/wiki/Single-precision_floating-point_format) that there are 23 digitals used to store decimal, which means the precision can only goes up to 7 decimal digitals, which is around 0.0000001. However, on the wiki page, it says the minimal value it can represent is: 0 00000001 00000000000000000000000 = 2−126 ≈ 1.175494351 × 10−38

so this is really wried. if the precision can only goes to 7 decimal digits in floating point, how could the smallest value even smaller than precision? isn't this mean that any number can be stored up to 38 decimal digits? which in that case, say if a number is 1.1234567891011121314, the floating point can extend to the last digit? I am really confused.

user2970089
  • 235
  • 3
  • 14
  • i have a hard time to follow your reasoning on 23 digits resulting in 7 digits precision – 463035818_is_not_an_ai Apr 13 '18 at 08:27
  • Floating point numbers are stored as a number plus an exponent term; for example both 42 and 4.2 x 10+999 have two decimal digits of precision, but their sizes are very, very different! – Ken Y-N Apr 13 '18 at 08:28
  • 2
    btw 1.175494351 × 10−38 has only 10 digits.... – 463035818_is_not_an_ai Apr 13 '18 at 08:28
  • Hm, the dupe is the same question, but the answers are not great. Someone should answer over there... – Baum mit Augen Apr 13 '18 at 08:29
  • Decimal precision means that standard guarantees precision up to 7th decimal digit. So for example, 0.1 + 0.1 + 0.1 might be equal to 0.300000095726 (it is equal to 0.3 up to 7th decimal place). The minimal value representalbe is 2^(-126), we it is only guaranteed that it is correctly represented up to 7th decimal digit: 1.175494 * 10^(-38) is for sure, but no guarantee for remaining digits. – Yksisarvinen Apr 13 '18 at 08:37
  • 1
    I think you're confusing "number of decimals" with "number of significant digits". – molbdnilo Apr 13 '18 at 08:44

0 Answers0