View Issue Details

IDProjectCategoryView StatusLast Update
00019941003.1(2008)/Issue 7System Interfacespublic2026-09-11 23:39
Reportertydeman Assigned Toajosey  
PrioritynormalSeverityEditorialTypeError
Status Under ReviewResolutionOpen 
NameFred Tydeman
OrganizationTydeman Consulting
User Referencehttps://pubs.opengroup.org/onlinepubs/9799919799/functions/exp.html
Sectionexp
Page NumberOnline version has no page number
Line NumberOnline version has no line number
Interp Status
Final Accepted Text
Summary0001994: exp() assumes default rounding
DescriptionIf 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 ActionIt 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.
TagsNo tags attached.

Activities

bhaible

2026-09-11 22:20

reporter   bugnote:0007495

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.

hvd

2026-09-11 23:39

reporter   bugnote:0007496

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.

Issue History

Date Modified Username Field Change
2026-07-29 08:40 tydeman New Issue
2026-07-29 08:40 tydeman Status New => Under Review
2026-07-29 08:40 tydeman Assigned To => ajosey
2026-09-11 22:20 bhaible Note Added: 0007495
2026-09-11 23:39 hvd Note Added: 0007496