View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000068 | 1003.1(2008)/Issue 7 | System Interfaces | public | 2009-06-26 15:49 | 2013-04-16 13:06 |
| Reporter | msbrown | Assigned To | ajosey | ||
| Priority | normal | Severity | Comment | Type | Error |
| Status | Closed | Resolution | Accepted As Marked | ||
| Name | Mark Brown | ||||
| Organization | IBM | ||||
| User Reference | |||||
| Section | tgamma | ||||
| Page Number | 2105 | ||||
| Line Number | 66605 | ||||
| Interp Status | Approved | ||||
| Final Accepted Text | 0000068:0000125 | ||||
| Summary | 0000068: tgamma range error overflow text | ||||
| Description | COMMENT Enhancement Request Number 6 mtk.manpages:xxxxxxxxx Bug in XSHd5.1 tgamma (rdvk# 4) {tgamma} Thu, 24 Jul 2008 07:04:12 +0100 (BST) _____________________________________________________________________________ In Section 7.12.8.4 of the C99 spec, it says: A range error may occur if the magnitude of x is too large or too small. XSH specifies the overflow condition, but does not specify the underflow condition. It should also specify the underflow condition. | ||||
| Desired Action | At line 66605, append the following text: == If the correct value would cause underflow, a range error shall occur and tgamma(), tgammaf(), and tgammal() shall return 0. == (A point about which I'm unsure mathematically is whether the last piece should read: ... shall return 0, with the same sign as the correct value of the function. I'll leave that to the math experts.) ========== At line 66626, append the following text: == Range Error The value underflows. If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised. | ||||
| Tags | tc1-2008 | ||||
|
|
Interpretation response ------------------------ The standard does not speak to this issue, and as such no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor. Rationale: ------------- None. Notes to the Editor (not part of this interpretation): ------------------------------------------------------- This is a cross volume change All page and line numbers are for draft 5.1. Changes to XBD ... At page 9 line 246 replace the description of the MX code with: MX IEC 60559 Floating-Point The functionality described is optional. The functionality described is mandated by the ISO C standard only for implementations that define __STDC_IEC_559__. and add an MXX code after it: MXX IEC 60559 Floating-Point Extension The functionality described is part of the IEC 60559 Floating-Point option, but is an extension to the ISO C standard. (The "part of" here is because the functionality provided by both MX and MXX is available when __STDC_IEC_559__ is defined. Effectively the two together form a single option.) Note that the above changes include removal of the second paragraph of the MX description: Where applicable, functions are marked with the MX margin legend in the SYNOPSIS section. Where additional semantics apply to a function, the material is identified by use of the MX margin legend. (This is because there are no functions whose SYNOPSIS has MX shading, so there is no need to distinguish between MX markers in the SYNOPSIS and those elsewhere.) Changes to XSH ... At P593 L20443 (asin), P595 L20501 (asinh), P599 L20603 (atan), P605 L20752 (atanh), P790 L26409 (expm1), P1249 L41188 (log1p), P1958 L62217 (sin), P1960 L62286 (sinh), P2074 L65711 (tan) and P2076 L65793 (tanh) change: [MX] If x is subnormal, a range error may occur and x should be returned.[/MX] to (substituting the appropriate function names for asin(), asinf() and asinl()): [MX] If x is subnormal, a range error may occur[/MX] [MXX] and x should be returned.[/MXX] [MX] If x is not returned, asin(), asinf(), and asinl() shall return an implementation-defined value no greater in magnitude than DBL_MIN, FLT_MIN, and LDBL_MIN, respectively.[/MX] At P601 L20660 (atan2) change: [MX] If the result underflows, a range error may occur and y/x should be returned.[/MX] to: If the correct value would cause underflow, a range error may occur, and atan2(), atan2f(), and atan2l() shall return an implementation-defined value no greater in magnitude than DBL_MIN, FLT_MIN, and LDBL_MIN, respectively. [MXX] If IEC 60559 Floating-Point is supported, y/x should be returned.[/MXX] At P765 L25519 (erf) change: [MX] If x is subnormal, a range error may occur, and 2 * x/sqrt(pi) should be returned.[/MX] to: If the correct value would cause underflow, a range error may occur, and erf(), erff(), and erfl() shall return an implementation-defined value no greater in magnitude than DBL_MIN, FLT_MIN, and LDBL_MIN, respectively. [MXX] If IEC 60559 Floating-Point is supported, 2 * x/sqrt(pi) should be returned.[/MXX] At P767 L25583 (erfc) change: If the correct value would cause underflow and is not representable, a range error may occur and [MX] either 0.0 (if representable), or[/MX] an implementation-defined value shall be returned. to: If the correct value would cause underflow, [MXX]and is not representable[/MXX], a range error may occur, and erfc(), erfcf(), and erfcl() shall return [MXX] 0.0, or [/MXX] (if IEC 60559 Floating-Point is not supported) an implementation-defined value no greater in magnitude than DBL_MIN, FLT_MIN, and LDBL_MIN, respectively. At P767 L25589 (erfc) change MX shading to MXX for: If the correct value would cause underflow and is representable, a range error may occur and the correct value shall be returned. At P786 L26270 (exp), P788 L26347 (exp2), P870 L28890 (fmod), P1210 L39939 (ldexp), P1518 L49006 (pow) and P2074 L65707 (tan) change: If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or[/MX] an implementation-defined value shall be returned. to (substituting the appropriate function names for exp(), expf() and expl()): If the correct value would cause underflow, [MXX]and is not representable[/MXX], a range error may occur, and exp(), expf(), and expl() shall return [MXX] 0.0, or [/MXX] (if IEC 60559 Floating-Point is not supported) an implementation-defined value no greater in magnitude than DBL_MIN, FLT_MIN, and LDBL_MIN, respectively. At P1795 L57424 (scalbln) change: If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or[/MX] an implementation-defined value shall be returned. to: If the correct value would cause underflow, [MXX]and is not representable[/MXX], a range error may occur, and scalbln(), scalblnf(), scalblnl(), scalbn(), scalbnf(), and scalbnl() shall return [MXX] 0.0, or [/MXX] (if IEC 60559 Floating-Point is not supported) an implementation-defined value no greater in magnitude than DBL_MIN, FLT_MIN, LDBL_MIN, DBL_MIN, FLT_MIN, and LDBL_MIN, respectively. At P786 L26276 (exp), P788 L26353 (exp2), P870 L28899 (fmod), P1210 L39943 (ldexp), P1519 L49029 (pow), P1795 L57429 (scalbln) and P2074 L65714 (tan) change MX shading to MXX for: If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned. At P818 L27345 (fdim) change: If x-y is positive and underflows, a range error may occur, and either (x-y) (if representable), [XSI] or 0.0 (if supported),[/XSI] or an implementation-defined value shall be returned. to: If the correct value would cause underflow, a range error may occur, and fdim(), fdimf(), and fdiml() shall return [MXX] the correct value, or [/MXX] (if IEC 60559 Floating-Point is not supported) an implementation-defined value no greater in magnitude than DBL_MIN, FLT_MIN, and LDBL_MIN, respectively. At P819 L27364 (fdim) delete from APPLICATION USAGE: On implementations supporting IEEE Std 754-1985, x-y cannot underflow, and hence the 0.0 return value is shaded as an extension for implementations supporting the XSI option rather than an MX extension. At P1098 L36650 (hypot) change MX shading to MXX for: If both arguments are subnormal and the correct result is subnormal, a range error may occur and the correct result is returned. and change "is returned" to "shall be returned". At P1196 L39586 (j0) add MXX shading to: If x is NaN, a NaN shall be returned. At P1367 L44844 (nextafter) change: [MX] If x!=y and the correct function value is subnormal, zero, or underflows, a range error shall occur, and either the correct function value (if representable) or 0.0 shall be returned.[/MX] to: [MX] If x!=y and the correct function value is subnormal, zero, or underflows, a range error shall occur, and[/MX] [MXX] the correct function value (if representable) or[/MXX] [MX] 0.0 shall be returned.[/MX] At P2105 L66604 (tgamma) add: If the correct value would cause underflow, [MXX]and is not representable[/MXX], a range error may occur, and tgamma(), tgammaf(), and tgammal() shall return [MXX] 0.0, or [/MXX] (if IEC 60559 Floating-Point is not supported) an implementation- defined value no greater in magnitude than DBL_MIN, FLT_MIN, and LDBL_MIN, respectively. [MXX] If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.[/MXX] At P2106 L66636 (tgamma) add: Range Error The result underflows. If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised. At P2274 L71531 (y0) add MXX shading to: If x is NaN, a NaN shall be returned. (Target for TC1) |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2009-06-26 15:49 | msbrown | New Issue | |
| 2009-06-26 15:49 | msbrown | Status | New => Under Review |
| 2009-06-26 15:49 | msbrown | Assigned To | => ajosey |
| 2009-06-26 15:49 | msbrown | Name | => Mark Brown |
| 2009-06-26 15:49 | msbrown | Organization | => IBM |
| 2009-06-26 15:49 | msbrown | Section | => tgamma |
| 2009-06-26 15:49 | msbrown | Page Number | => 2105 |
| 2009-06-26 15:49 | msbrown | Line Number | => 66605 |
| 2009-06-26 15:49 | msbrown | Note Added: 0000125 | |
| 2009-06-26 15:49 | msbrown | Status | Under Review => Interpretation Required |
| 2009-06-26 15:49 | msbrown | Resolution | Open => Accepted As Marked |
| 2009-06-26 15:50 | msbrown | Final Accepted Text | => 0000068:0000125 |
| 2009-08-11 16:29 | Don Cragun | Interp Status | => Pending |
| 2009-09-17 15:41 | nick | Interp Status | Pending => Proposed |
| 2009-10-09 16:33 | ajosey | Note Edited: 0000125 | |
| 2009-10-09 16:33 | ajosey | Interp Status | Proposed => Approved |
| 2010-09-20 09:12 | geoffclare | Tag Attached: tc1-2008 | |
| 2010-11-05 17:11 | geoffclare | Relationship added | related to 0000348 |
| 2013-04-16 13:06 | ajosey | Status | Interpretation Required => Closed |
| 2020-12-17 17:12 | nick | Relationship added | related to 0001382 |