Submitter: J11
Submission Date: 2006-07-18
Source: Fred J. Tydeman
Reference Document: N1183
Version: 1.3
Date: 2007-10-30
Subject:Externally visible exceptional conditions.
Summary
C99 7.12.1 Treatment of error conditions paragraph 1 has: Each function shall execute as if it were a single operation without generating any externally visible exceptional conditions.
As written, I believe that means that errno
cannot be altered by any math function, nor can any of the
floating-point exceptions mentioned later in 7.12.1 ("invalid",
"divide-by-zero", "overflow", "underflow") be raised by any math
function.
That was not our intent.
Seems to me that there are two problems with that text in 7.12.1:
Suggested Technical Corrigendum
Committee Discussion
In the Rationale, please add to section 6.5 Expressions, as a new paragraph, words along the lines of:
The "inexact" floating-point exception is NOT an exceptional condition because "inexact" arises from computing a mathematically defined value in the range of representable values, therefore, from the definition, "inexact" is not exceptional. This matters for spurious exceptional conditions in the math library (7.12.1).
Proposed Technical Corrigendum
Change 7.12.1 paragraph 1 last sentence to:
Each function shall execute as if it were a single operation without generating any of the exceptions "invalid", "divide-by-zero", or "overflow" except to reflect the result of the function.