question about sign of DFP interest
Vincent Lefevre
vincent@vinc17.net
Fri Feb 13 03:50:01 GMT 2026
On 2026-02-12 22:30:29 -0500, Steve Summit wrote:
> But then, any C programmer might want to use DFP, now that it's
> part of the Standard. For one thing, many programmers, when
> they're first playing with floating point, and encountering
> surprises such as that 0.1 + 0.2 != 0.3, and asking about these
> surprises online, are told that they're due to "deficiencies in
> IEEE754 floating point" and that they "might want to try using
> decimal floating point instead."
Well, no. 0.1 + 0.2 == 0.3 is just an example that happens to
work in decimal. You are lucky. This will certainly not eliminate
"surprises". For instance: (1.0 / 3.0) * 3.0 != 1.0.
But perhaps C should have rational arithmetic, for expressions
that use only the basic arithmetic operations. :-)
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
More information about the Libc-alpha
mailing list