[Cfp-interest 2090] Re: Underflow

Jim Thomas jaswthomas at sbcglobal.net
Mon Aug 9 16:41:16 PDT 2021


The following rewrite of the C overflow and underflow definitions is intended to address the issues pointed out by Vincent.

 A floating result overflows if a finite result with ordinary accuracy*) would have magnitude (absolute value) larger than the maximum normalized number in the specified type. (A result that is an exact infinity does not overflow.)

[The last sentence is parenthesized because it is subtly implied by the definition (the if statement is vacuously true).]

The result underflows if a nonzero result with ordinary accuracy would have magnitude (absolute value) less than the minimum normalized number in the type; however, a zero result that is specified to be an exact zero does not underflow. Also, a result with ordinary accuracy and the magnitude of the minimum normalized number may underflow.249) 

[This does not base the specification essentially on the delivered result. The result to be delivered when underflow occurs is addressed further on in 5.2.4.2.2 #6.]

*)Ordinary accuracy is determined by the implementation. It refers to the accuracy of the function where results are not compromised by extreme magnitude.

249)The term underflow here is intended to encompass both "gradual underflow" as in IEC 60559 and also "flush-to-zero" underflow. IEC 60559 underflow can occur in cases where the magnitude of the rounded result (accurate to the full precision of the type) equals the minimum normalized number.

- Jim Thomas


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20210809/b9488e21/attachment-0001.htm>


More information about the Cfp-interest mailing list