[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Importing NaNs
Should the Standard address importing of FP data from foreign systems?
The concrete representations have to be converted during import. The
Standard could define a Wire Form representation, and require that any
implementation support conversion to and from Wire Form. It appears that the
current expectation is that textual representation would serve as Wire Form,
and that is probably true for decimal radix implementations. But a round
trip of a binary representation to text and back looks to lose bits (not
sure of this). This could be avoided if the text form supported choice of
exponent radix, which you may have already discussed. However, even text
with choice of radix will not help when the source and target
implementations use different radices.
As a second note, it seems probably that many systems will store "useful"
information in the the spare bits of a NaN in an implementation defined way.
NaNs imported from foreign systems will have meaningless bits in a NaN on
the new host, and the hardware and software behavior of the host in the
presence of these bits might be undefined (by the host as well as the
standard) and no doubt unfortunate. This suggests that there needs to be a
Wire Form for NaNs too. The Wire Form (which might be text) should at least
indicate the kind of NaN.
Ivan