View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001994 | 1003.1(2008)/Issue 7 | System Interfaces | public | 2026-07-29 08:40 | 2026-09-11 23:39 |
| Reporter | tydeman | Assigned To | ajosey | ||
| Priority | normal | Severity | Editorial | Type | Error |
| Status | Under Review | Resolution | Open | ||
| Name | Fred Tydeman | ||||
| Organization | Tydeman Consulting | ||||
| User Reference | https://pubs.opengroup.org/onlinepubs/9799919799/functions/exp.html | ||||
| Section | exp | ||||
| Page Number | Online version has no page number | ||||
| Line Number | Online version has no line number | ||||
| Interp Status | |||||
| Final Accepted Text | |||||
| Summary | 0001994: exp() assumes default rounding | ||||
| Description | If the correct value would cause overflow, a range error shall occur and exp(), expf(), and expl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively. | ||||
| Desired Action | It should be: If the correct value would cause overflow, a range error shall occur. If default rounding is in effect, exp(), expf(), and expl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively. This same issue may apply to many other math functions. | ||||
| Tags | No tags attached. | ||||
|
|
Why would this change be necessary? Both ISO C 23 ยง 7.6 and https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/fenv.h.html say "A function call is assumed to require default floating-point control modes, unless its documentation promises otherwise." The rounding mode is a control mode. Therefore the specification of exp(), expf(), expl() does not need to specify the results of calling these functions with a non-default rounding mode. |
|
|
The link you give explicitly makes it non-normative though, it shows how <fenv.h> is intended to be used but does not require programmers to follow this. And in the C standard, although that same statement does appear in the normative text, it still appears under "Certain application programming conventions support the intended model of use for the floating-point environment" and does not require programmers to use these same conventions. I think that means standard library functions are required to behave as specified even in non-default rounding modes. |