[cfp-interest 3481] Re: Range error conditions for atan2 and atan2pi
Jim Thomas
jaswthomas at sbcglobal.net
Thu May 29 16:53:06 PDT 2025
“Subnormal" applies to certain numbers in a floating-point format. Formats for C floating types are not required to include subnormal numbers. Even if they were, “subnormal” would not apply here. y/x is a mathematical expression with a mathematical value which is not generally a floating-point number.
C wording does mix the concepts sometimes. We say C functions return some mathematical expression, e.g. atan2 functions return arctan(y/x). We mean the C functions return an approximation (usually of unspecified accuracy) of the mathematical value of the expression as a floating-point number in the return type.
Importantly, the “is too close” wording in 7.12 is intentionally vague, leaving the implementation much flexibility to determine where range errors occur. The specification must apply to implementations with varying accuracy and rounding methods, and with or without subnormals. Annex F is less flexible about “underflow” and “overflow” floating-point exceptions.
- Jim Thomas
> On May 28, 2025, at 7:29 PM, Damian McGuckin <damianm at esi.com.au> wrote:
>
> On Wed, 28 May 2025, Damian McGuckin wrote:
>
>>> ... occurs if both x is positive and also nonzero y/x is too close to zero
>
> Given that 5.3.5.3.3 defines a subnormal number indepedent of ISO 60559 support, should we say
>
> ... and also y/x is subnormal.
>
> The concept of "nonzero BLOB is too close to zero" only exists in Section 7
> 18 times for the trigonometric, exponent and logarithmic routines.
>
> Everywhere else, it is called "subnormal" and used 50+ times.
>
> Thanks - Damian
More information about the cfp-interest
mailing list