[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optional hexadecimal-string support -- 1.8.0 inconsistent now!



There is sometimes a need to initialise binary floating-point constants
to precisely-defined values.  For example, some algorithms require a
representation of ln(2.0) as a sum of two doubles where the first one
has a certain known number of trailing zeros in its significand.  These
cases tend to be difficult to deal with in supposedly-portable code.

Not really.  Tedious, but no more.  It isn't even very tricky.

In my (fairly extensive) experience of writing code that needed such
things, I have needed the ability to produce a bit-pattern perhaps
a hundred times as often as I have needed the ability to input a
mantissa in binary.  This becomes MORE important with the proposed
decimal, because of the encodings that can't be produced by normal
arithmetic.

Yes, of course, that is for error detection, testing and similar
loathesome activities - but doesn't every numerical software
engineer have more code dedicated to such things than the main
algorithms? :-)  Joking apart, it really is important, and it can
be specified portably for a format that defines the meanings of
all bits.

But that sort of binary input has conceptually almost nothing to
do with 'normal' number representations.


Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email:  nmm1@xxxxxxxxx
Tel.:  +44 1223 334761    Fax:  +44 1223 334679


754 | revision | FAQ | references | list archive