Re: Constructors motion 30 Version 2: small amendment
On 2012-02-08 09:27:21 -0500, Michel Hack wrote:
> Vincent Lev?vre a ?crit:
> > > Surely he [Dan Z] meant:
> > > ?text2num(text,roundDown), text2num(text,roundUp)?.
> >
> > That's very ambiguous. What if text is "3/pi"? Does roundDown mean
> > that one should use this rounding direction for all operations, ...
>
> Unlike text2interval(), text2num() (if referring to the 754-2008 one)
> only applies to decimal (or perhaps other bases) digit strings, so this
> issue does not arise (nor does text2num("[1,2]"), for the same reason).
>
> In any case, the meaning of rounding for 754-2008 operations applies
> only ONCE, in coercing the result to a result format (formatOf concept).
> So both explicit (as a 2nd argument) or implicit (as local mode) rounding
> are unambiguous when applied to a single operation.
Dan Zuras said:
P.S. - While num2interval() takes a floating-point
number as input I'm sure that text2interval() can
be made safe by defining the output to be
[roundDown(text2num(text)),roundUp(text2num(text))].
So, even after correcting the last line to
[text2num(text,roundDown),text2num(text,roundUp)]
text2interval cannot be expressed with text2num on general text.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)