Re: P1788 input/output: exact text representation
Am Tue, 23 Jul 2013 21:39:28 +0100
schrieb John Pryce <j.d.pryce@xxxxxxxxxx>:
> However, I think Michel's observation about writing from one type and
> reading to another is both perceptive and valuable.
>
> Namely suppose type T' is wider than type T, meaning that regarded as
> sets of mathematical intervals, T is a subset of T'.
>
> Then if
> xx is a T-interval
> and we write xx out by
> s = T-interval2exact(xx).
> Michel says string s *should* be readable by T'-exact2interval and
> recover xx exactly: yy = T'-exact2interval(s)
> should be defined, and should have the same interval value as xx
> (though of a different type).
>
> E.g. to fix ideas, let T be inf-sup binary32 and T' be inf-sup
> binary64. Then interval yy should be just xx converted from single to
> double precision, but
>
> In fact, with the spec as given so far, this happens automatically if
> T and T' are 754-conforming types. I'm working on writing a suitable
> "should" statement for general types.
This seems to fall out of the current spec automatically, yes. But if
it doesn't in a more general way, than I would prefer to keep it simple
here.
If the importing system supports the originally used type, there is
always the possibility to read to the correct format and convert to a
wider one afterwards. The situation were the original format is not
supported seems quite special to me and probably doesn't deserve extra
handling if it complicates the standard, does it?
Christian