Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion P1788/M0044:Constructors -- Voting Period begins - controlling rounding mode



On 2013-05-16 21:24:36 -0400, Lee Winter wrote:
> The above code fragment makes a very dangerous assumption, to wit, that the
> atof() function from the compiler library is round-safe, which means that
> all of the functions it calls must also be round-safe..  In my experience
> few implementations make that claim.  And some of those that do make the
> claim are false.

See below.

On 2013-05-17 14:49:37 +0200, Vincent Lefevre wrote:
> On 2013-05-17 04:11:16 -0500, Ralph Baker Kearfott wrote:
> > Yes, I am aware of access to changing the rounding mode in modern
> > programming languages. What I was not aware of was that implementers
> > interpreted this to apply to text-to-interval conversions, and that
> > the text-to-interval conversion is done correctly from the point of
> > view of interval computations.

Ralph, I think the meant conversions between floating-point values
and text strings.

> Well, for string conversion, this is a bug. But all operations are
> concerned by bugs, even the basic arithmetic operations. See:
> 
>   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34678
>   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37838
> 
> For C's math.h functions, this is worse, as the ISO C standard doesn't
> require the rounding direction to be honored. You could only rely on
> QoI.

Oops, this should have been an answer to Lee Winter. The rounding
direction must be honor for conversions between floating-point values
and text strings.

-- 
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)