No subject
sun!research!doug
sun!research!doug
Mon Aug 13 20:48:09 PDT 1990
The "bug" that ANSI allows information to be lost on
converting int to float is not confined to comparison.
It can produce inexact answers to other int-float operations
where the exact answer is representable in the target type.
It would be silly to introduce some special rule
for comparisons while the general rule is still in effect.
A defensible rule would be that for mixed operations
integers must not be narrowed on conversion to floating type
(unless the floating type is the widest available).
See how that sits with the speed merchants, whose motto
is, "Never double solely out of kindness."
Doug McIlroy
Bell Labs
More information about the Numeric-interest
mailing list