[Cfp-interest] AI about remainder underflow

Jim Thomas jaswthomas at sbcglobal.net
Tue May 8 18:01:50 PDT 2018


Action item:
> Jim: Look at what is said in exception handling and make sure remainder underflow is addressed as per Jim's/Fred/David's email regarding 18661-1 and 754 (2018/04/09).    



F.10 (with or without 18661-1) says:

7 The ‘‘underflow’’ floating-point exception is raised whenever a result is tiny (essentially subnormal or zero) and suffers loss of accuracy.371) 

371) IEC 60559 allows different definitions of underflow. They all result in the same values, but differ on when the floating-point exception is raised.

and the remainder spec in annex F with 18661-1 does not mention underflow. This slips over the subtle definition of 754 underflow, but I think it's is ok because exact underflow is not user-detectable in C11 with 18661-1.

With 18661-5 exact underflow (including remainder underflow) might be detectable. The spec there is careful to reflect the subtlety. The alternate exception handling spec says:

[2] For the “underflow” exception, the chosen exception handling occurs if the exception is raised, whether the default result would be exact or inexact, unless stated otherwise.

The abrupt underflow spec says:

—         abrupt underflow. If an “underflow” floating-point exception occurs (see IEC 60559), the operation delivers a result with magnitude zero or the minimum normal magnitude (for the result format) and with the same sign as the default result, sets the “underflow” floating-point exception flag, and raises the “inexact” floating-point exception. …

The try-catch spec says:

[14] In most cases, the try and catch actions can be implemented like delayed-try and delayed-catch actions, though not for the “underflow” exception (which occurs without causing the “underflow” flag to be set, in cases of exact subnormal results). Such an implementation would not always handle the first occurring designated exception, as recommended.

I don’t see any needed to change 18661-1 or 18661-5.


- Jim Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20180508/f27ec626/attachment.html 


More information about the Cfp-interest mailing list