4 ms·
Because .3 cannot be described by a float exactly. And C/C++ doesn't have binary coded decimal natively. If it did, then much of what we use decimals and fract
by tarotuser 4y ago
Because .3 cannot be described by a float exactly.
And C/C++ doesn't have binary coded decimal natively. If it did, then much of what we use decimals and fractions for would be easier to show in decimal.
- peteri 4y agoI'm sure multiple variants have been implemented, Borland C++ V2.0 from 1991 (version chosen as it's on bitsavers.org) has a bcd type which IIRC uses the 80 bit 8087 packed decimal type but it's been a long time since I looked at this deeply.
- virgulino 4y agoI remember we had Borland Turbo Pascal 3.0 with BCD in the mid 1980s.