5 ms·
Isn’t that just what you get with double precision floats?
by flatline 4y ago
Isn’t that just what you get with double precision floats?
- hackernewds 4y agodouble precision float lens are related to the number of digits of pi that are relevant?
- xvedejas 4y agoWell kinda, the size of the mantissa is certainly chosen to be large enough to give the precision scientific computing would "typically" need, but that's considering trade-offs and just being vaguely good enough for most cases. Sometimes we use 80-bit extended precision floating point for example.
- andreareina 4y agoI thought 80-bit floats have been mostly deprecated due to getting different results depending on whether the compiler put the variables in main memory or not?
- adrian_b 4y ago80-bits have been deprecated because after Pentium Pro (end of 1995), the last Intel CPU in which the operations with 80-bit numbers have been improved, Intel has decided that the 8087 instruction set must be replaced (mainly because it used a single stack of registers, which is an organization incompatible with modern CPUs having multiple pipelined functional units, which need independent instructions, to be executed concurrently, while all instructions using the same stack are dependent) and that their future instruction set should not support more than double precision. From 1997 until 2000, Intel has introduced each year some instruction set features aimed at replacing the 8087 80-bit ISA and this process was completed at the end of 2000, with the introduction of Pentium 4. Since the end of 2000, more than 21 years ago, the use of the 80-bit floating-point numbers has been deprecated for all Intel CPUs (and since 2003, also for the AMD CPUs). The modern Intel and AMD CPUs still implement the 8087 ISA, only for compatibility with the old programs written before 2000, but they make no effort to make them run with a performance similar to that obtained when using modern instruction sets, like AVX-512 or AVX. If there are modern compilers which in 2022 still emit 8087 instructions to handle values declared as "long double" (unless specifically targeted to a pre-2000 32-bit CPU, e.g. Pentium Pro), I consider that as a serious bug. A compiler should either implement "long double" as the same as "double", which is allowed, but lazy and ugly, or it should implement the "long double" operations by calls to functions from a library implementing operations with either double-double or quadruple precision numbers, exactly how many compilers implement operations with 128-bit integers on all CPUs or with 64-bit integers on 32-bit CPUs.
- _moof 4y agoIt is, yes.
- kens 4y agoYes, this is kind of a pointless post since it doesn't answer the question in the title. Instead, they just show that the "default" number of digits is enough.
- brudgers 4y agoJPL needs the number of digits in a double float because JPL needs to use double floats because JPL is performing engineering. Paradoxically, double floats are engineered to provide more digits than you need because you need more digits than you need when engineering because if you don’t have insignificant digits to drop, you don’t have enough digits.
- saagarjha 4y ago> double floats are engineered to provide more digits than you need because you need more digits than you need Now that's definitely a mild brain-teaser
- mlyle 4y ago> Instead, they just show that the "default" number of digits is enough. The "default" number of digits was chosen and became the default because it's enough for mostly everything.