[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: stds-754 <stds-754@xxxxxxxxxxxxxxxxx>*Subject*: Re: Conflicts between C standard and 754-2008*From*: Vincent Lefevre <vincent@xxxxxxxxxx>*Date*: Sun, 2 Jan 2011 03:15:47 +0100*In-reply-to*: <201101012205.p01M5tKf022316@xxxxxxxxxxxxxxxxxxx>*List-help*: <http://listserv.ieee.org/cgi-bin/wa?LIST=STDS-754>, <mailto:LISTSERV@LISTSERV.IEEE.ORG?body=INFO%20STDS-754>*List-owner*: <mailto:STDS-754-request@LISTSERV.IEEE.ORG>*List-subscribe*: <mailto:STDS-754-subscribe-request@LISTSERV.IEEE.ORG>*List-unsubscribe*: <mailto:STDS-754-unsubscribe-request@LISTSERV.IEEE.ORG>*Mail-followup-to*: stds-754 <stds-754@xxxxxxxxxxxxxxxxx>*References*: <201101012205.p01M5tKf022316@xxxxxxxxxxxxxxxxxxx>*Sender*: stds-754@xxxxxxxx*User-agent*: Mutt/1.5.21-6165-vl-r38670 (2010-12-30)

On 2011-01-01 16:51:11 -0500, Michel Hack wrote:

Fred Tydeman mentionedC1X (currently being voted on) can be found at: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1539.pdfWhy does this document -- claiming a base date of 2010 -- not have even a hint of IEEE 754-2008? The 1985 standard expired years ago...

Because most work was done before IEEE 754-2008 got finalized? The implementations are also a problem. For instance, GCC still doesn't implement C99 very well concerning the floating-point arithmetic. On <http://gcc.gnu.org/c99status.html> the only feature marked as broken is "IEC 60559 (also known as IEC 559 or IEEE arithmetic) support".

I'm glad though that it fixes the overflow issue -- though as Nick MacLaren points out in his stds-1788 reply, the fix now simply leaves overflow handling for directed rounding just plain UNDEFINED, which could be considered a step backwards.

I disagree that it is undefined (see below).

Or does the cited extract from Annex F: "Functions such as strtod that convert character sequences to floating types honor the rounding direction." imply a proper result definition for overflow? I don't think so, as returning zero could also "honor the rounding direction"!

This is not completely defined for the underflow, but the overflow is perfectly defined. Zero would often be forbidden by the following recommendation: If the subject sequence has the decimal form and at most DECIMAL_DIG (defined in <float.h>) significant digits, the result should be correctly rounded. If the subject sequence D has the decimal form and more than DECIMAL_DIG significant digits, consider the two bounding, adjacent decimal strings L and U, both having DECIMAL_DIG significant digits, such that the values of L, D, and U satisfy L â D â U. The result should be one of the (equal or adjacent) values that would be obtained by correctly rounding L and U according to the current rounding direction, with the extra stipulation that the error with respect to D should have a correct sign for the current rounding direction. and F.5 says: Conversions involving IEC 60559 formats follow all pertinent recommended practice. In particular, conversion between any supported IEC 60559 format and decimal with DECIMAL_DIG or fewer significant digits is correctly rounded (honoring the current rounding mode), which assures that conversion from the widest supported IEC 60559 format to decimal with DECIMAL_DIG digits and back is the identity function. -- 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 / ArÃnaire project (LIP, ENS-Lyon)

**References**:**Re: Conflicts between C standard and 754-2008***From:*Michel Hack

- Prev by Date:
**Re: Conflicts between C standard and 754-2008** - Next by Date:
**Re: Conflicts between C standard and 754-2008** - Previous by thread:
**Re: Conflicts between C standard and 754-2008** - Next by thread:
**Re: Conflicts between C standard and 754-2008** - Index(es):