Re: P1788 input/output
Vincent Lefèvre wrote, concerning equality of "exact representations":
> Now, I was also thinking of the usual IEEE 754 conversion property: a
> binary number is often output as decimal with enough digits to recover
> the original value when interpreting it in rounding-to-nearest in the
> same floating-point format. This property is used by the XML schema
> spec (datatypes).
This gets us back to "recoverable representations" which I had brought
up a number of times in the past. The problem here is that one has to
record or remember (a) the original type, and (b) the fact that this
was indeed the result of intervalToRecoverable() -- because recovery
will have to apply compatible rounding to recover the original interval.
One of the conversion directions is likely to (technically) violate
the containment rule, so one always has to be mindful of context. Both
intervalToRecoverable() and recoverableToInterval() could use to-nearest,
or one could use outward rounding and the other inward rounding.
The nice thing with exact representations is that these difficulties
can be avoided.
Michel.
---Sent: 2013-07-22 15:17:03 UTC