From 664443126819168348
X-Google-Thread: f78e5,9ea02bfab7bc90f,start
X-Google-NewGroupId: yes
X-Google-Attributes: gid7894ca11fe,domainid0,public,usenet
X-Google-Language: ENGLISH,UTF8
Path: g2news2.google.com!news2.google.com!news.glorb.com!news.alt.net!frodo.cs.rpi.edu!not-for-mail
From: David Krauss <potswa@mac.com>
Newsgroups: comp.std.c++
Subject: Defect Report: is_iec559 should be defined in terms of binary format
Date: Sat, 27 Mar 2010 12:41:34 CST
Organization: unknown
Lines: 45
Sender: cppmods@cs.rpi.edu
Approved: stephen.clamage@sun.com
Message-ID: <71C0DB7F-160E-4393-A3AE-39C1AC6B6C7D@mac.com>
NNTP-Posting-Host: netlab.cs.rpi.edu
Content-Type: text/plain; charset=windows-1252
To: (Usenet)
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
X-Original-Date: Fri, 26 Mar 2010 23:42:13 -0500
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Xref: g2news2.google.com comp.std.c++:2322

My implementation reports numeric_limits<long double>::is_iec559 == true for 
the Intel 80-bit format. Intel 80 is not defined by or related to IEC 559; an 
alternative 128-bit format is.

Perhaps one source of this issue is the grandfather clause in C99 §F.2/1 
footnote 307:

	Extended is IEC 60559s double-extended data format. Extended refers to 
both the common 80-bit and quadruple 128-bit IEC 60559 formats.

This would seem to be trying to change the very content of IEC 559!

However, to put this in context, note that C99 provides the user with much 
less information about the implementation. From §F.1/1:

	An implementation that defines _ _STDC_IEC_559_ _ shall conform to the 
specifications in this annex.

There is one macro and no other compliance information. If Intel 80 were 
considered non-compliant, it would preclude its use entirely on IEC 559 
compliant C implementations. C++ does not have this issue: the user queries FP 
types for compliance individually. I believe this justifies an exception to 
the trend of deferring numeric decisions to the C spec.

Moreover, no C++ standard explicitly refers to C FP at all. The definition of 
is_iec559, §18.2.1.2/52, says simply

	52	True if and only if the type adheres to IEC 559 standard.

This is ambiguous enough to allow Intel 80 if you consider IEC 559's provision 
for arbitrary formats adhering to the principles and features of the 
explicitly defined formats. But that interpretation would make is_iec559 
meaningless: other members of numeric_traits<> already describe the features 
of a FP type that would contribute to compliance besides binary format. So 
there is really no other information for it to convey.

	- Cheers,
	David

-- 
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



