3 ms·
Since you're an expert, I'm sure you won't mind these corrections: > IEEE 64 bit floats That should be IEEE 64-bit floating-point. The name `float` is a 32-b
by jdmichal 4y ago
Since you're an expert, I'm sure you won't mind these corrections:
> IEEE 64 bit floats
That should be IEEE 64-bit floating-point. The name `float` is a 32-bit floating-point.
> are accurate to just past 15 decimal digits.
FOR SOME RANGE. They're called floating-point because they can modify how much scaling is devoted to either side of the decimal point. The more scale it has to devote to representing whole portion, the lower its precision in the fractional portion. At some point, a 64-bit floating-point value cannot represent any decimal digits. Past around 2^53, a `double` 64-bit floating-point value cannot even represent every whole number, because at that point the available precision is 2 or more.
- kazinator 4y agoA "float" is 32 bit floating-point in the C language, yes. If I say "64 bit float", it's obviously not that one. Here is CLISP: [1]> (type-of 3.0) SINGLE-FLOAT [2]> (type-of 3.0d0) DOUBLE-FLOAT Python3: >>> type(3.0) <class 'float'> >>> type(3.0e300) <class 'float'> Looks like it's calling the 64 bit ones just float. Rust has f32 and f64. Some historic languages have used type names like REAL and DOUBLE and others. "IEEE 64 bit float" is almost unambiguous; it could be the binary one or the decimal one. IEEE uses identifiers like binary64, decimal32, if you want to be pedantic, and not float and double. > FOR SOME RANGE ... Your comment is seems to be based on the wrong idea of what the number of digits means. An IEEE 64 bit binary float stores 15 significant digits without loss. In that C language that gives us the float type, the preprocessor constant DBL_DIG has a value of 15 (on IEEE floating point platforms). This is a 15 digit number using E notation (in terms of digits of precision / significant figures): 1.23456789012345E-20 So is this; it is not a 16 digit number: 123456789012345.0 And so is this isn't a 17 digit one: 12345678901234500.0 (same as 1.23456789012345E16) You have to write the number in exponentatial notation, and chop the trailing zeros. Then count the remaining number number of digits in the mantissa part. I think it's only for subnormal numbers that the 15 rule breaks down; but I might have mentioned that. These are special representations close to zero beyond what is reachable with the regular exponent and mantissa, which have the benefit of certain desirable behaviors in underflow situations.
- IshKebab 4y agoI don't think experts like pointless and incorrect pedantry anymore than anyone else. Well maybe a little more because they can easily put you in your place. :)