| 1 |
From mail-miner-10529@localhost Wed Dec 18 12:07:55 2002 |
| 2 |
Received: from mailman.opengroup.org ([192.153.166.9]) |
| 3 |
by deep-dark-truthful-mirror.pad with smtp (Exim 3.36 #1 (Debian)) |
| 4 |
id 18Buh5-0006Zr-00 |
| 5 |
for <[email protected]>; Wed, 13 Nov 2002 10:24:23 +0000 |
| 6 |
Received: (qmail 1679 invoked by uid 503); 13 Nov 2002 10:10:49 -0000 |
| 7 |
Resent-Date: 13 Nov 2002 10:10:49 -0000 |
| 8 |
Date: Wed, 13 Nov 2002 10:06:51 GMT |
| 9 |
From: Andrew Josey <[email protected]> |
| 10 |
Message-Id: <[email protected]> |
| 11 |
In-Reply-To: Joanna Farley's message as of Nov 13, 9:56am. |
| 12 |
References: |
| 13 |
<[email protected]> |
| 14 |
<[email protected]> |
| 15 |
<[email protected]> |
| 16 |
X-Mailer: Z-Mail (5.0.0 30July97) |
| 17 |
To: [email protected] |
| 18 |
Subject: Re: Defect in XBD lround |
| 19 |
MIME-Version: 1.0 |
| 20 |
Resent-Message-ID: <gZGK1B.A.uY.iUi09@mailman> |
| 21 |
Resent-To: [email protected] |
| 22 |
Resent-From: [email protected] |
| 23 |
X-Mailing-List: austin-group-l:archive/latest/4823 |
| 24 |
X-Loop: [email protected] |
| 25 |
Precedence: list |
| 26 |
Resent-Sender: [email protected] |
| 27 |
Content-Type: text/plain; charset=us-ascii |
| 28 |
|
| 29 |
Joanna, All |
| 30 |
|
| 31 |
Thanks. I got the following response from Fred Tydeman. |
| 32 |
|
| 33 |
C99 Defect Report (DR) 240 covers this. The main body of C99 |
| 34 |
(7.12.9.7) says range error, while Annex F (F.9.6.7 and F.9.6.5) |
| 35 |
says "invalid" (domain error). The result was to change 7.12.9.7 |
| 36 |
to allow for either range or domain error. The preferred error |
| 37 |
is domain error (so as match Annex F). So, no need to change XBD. |
| 38 |
|
| 39 |
regards |
| 40 |
Andrew |
| 41 |
|
| 42 |
On Nov 13, 9:56am in "Re: Defect in XBD lr", Joanna Farley wrote: |
| 43 |
> Sun's expert in this area after some discussions with a colleague |
| 44 |
> outside of Sun concluded that for lround, to align with both C99 and SUS |
| 45 |
> changes of the following form were necessary: |
| 46 |
> |
| 47 |
> + If x is +/-Inf/NaN, a domain error occurs, and |
| 48 |
> + errno is set to EDOM in MATH_ERRNO mode; |
| 49 |
> + the invalid exception is raised in MATH_ERREXCEPT mode. |
| 50 |
> [to align with C99 Annex F.4] |
| 51 |
> |
| 52 |
> + If x is too large to be represented as a long, a *range* error |
| 53 |
> may occur, and |
| 54 |
> + errno *may be* set to ERANGE in MATH_ERRNO mode; |
| 55 |
> [to align with C99 7.12.9.7] |
| 56 |
> + the invalid exception *is* raised in MATH_ERREXCEPT mode. |
| 57 |
> [to align with C99 Annex F.4] |
| 58 |
> |
| 59 |
> They believe it is a bit awkward to have errno set to ERANGE in |
| 60 |
> MATH_ERRNO mode yet the invalid exception raised in MAH_ERREXCEPT mode, |
| 61 |
> but that just reflects an imperfect mapping of the C notion of errno to |
| 62 |
> the IEEE 754 notion of data conversion. |
| 63 |
> |
| 64 |
> I'll work with our expert to draft text refecting the above to suggest |
| 65 |
> replacement text for lines 23678-23684 on lround page 721 of XSH6. |
| 66 |
> |
| 67 |
> Thanks |
| 68 |
> |
| 69 |
> Joanna |
| 70 |
> |
| 71 |
> |
| 72 |
> Andrew Josey wrote: |
| 73 |
> > |
| 74 |
> > The text referred to is MX shaded and part of the ISO 60559 floating |
| 75 |
> > point option. I do not think changing the Domain Error to a Range Error |
| 76 |
> > is the fix or at least not the fix for the NaN and +-Inf cases. ISO C |
| 77 |
> > 99 describes the range error case if the magnitude of x is too large as a |
| 78 |
> > may fail. I'll ask Fred T for his thoughts on this one... |
| 79 |
> > regards |
| 80 |
> > Andrew |
| 81 |
> > |
| 82 |
> > On Nov 12, 9:37am in "Defect in XBD lround", [email protected] wrote: |
| 83 |
> > > Defect report from : Erwin Unruh , Fujitsu Siemens Computers |
| 84 |
> > > |
| 85 |
> > > (Please direct followup comments direct to [email protected]) |
| 86 |
> > > |
| 87 |
> > > @ page 0 line 0 section lround objection {0} |
| 88 |
> > > |
| 89 |
> > > Problem: |
| 90 |
> > > |
| 91 |
> > > Defect code : 1. Error |
| 92 |
> > > |
| 93 |
> > > The function lround is described in http://www.opengroup.org/onlinepubs/007904975/functions/lround.html |
| 94 |
> > > On Error it is specified that errno has to be set to EDOM. However, the C99 standard ISO/IEC 9899:1999 (E) specifies this as a range error, which would result in a value of ERANGE. So an implementation could not be conformant to both these standards. |
| 95 |
> > > |
| 96 |
> > > Action: |
| 97 |
> > > |
| 98 |
> > > Change the value of errno to ERANGE, if the result is not represantable. More specific: In the description of the function, replace all occurences of "domain error" with "range error" and replace "EDOM" with "ERANGE" |
| 99 |
> > >-- End of excerpt from [email protected] |
| 100 |
> > |
| 101 |
|
| 102 |
----- |
| 103 |
Andrew Josey The Open Group |
| 104 |
Austin Group Chair Apex Plaza,Forbury Road, |
| 105 |
Email: [email protected] Reading,Berks.RG1 1AX,England |
| 106 |
Tel: +44 118 9508311 ext 2250 Fax: +44 118 9500110 |