[cfp-interest 3473] Re: Range error conditions for atan2 and atan2pi
Jim Thomas
jaswthomas at sbcglobal.net
Tue May 27 15:14:36 PDT 2025
Damian, thanks for catching this and offering some fixes.
> On May 26, 2025, at 4:56 PM, Damian McGuckin <damianm at esi.com.au> wrote:
>
> On Mon, 26 May 2025, RAJAN BHAKTA wrote:
>
>> Javier asked that CFP write up and present the correction proposal and the following is the write up (Thank you Jim for doing this!)
>> https://wiki.edg.com/pub/CFP/WebHome/C2Y proposal - Clarification of range error condition for atan2-20250525.pdf
>
> There is now an slight inconsistency between atan() and atan2():
>
> atan says:
>
> ... occurs if nonzero x is too close to zero
>
> atan2 now says:
>
> ... occurs if x is positive and if y/x is nonzero and too close to zero
>
> The double usage of 'if' is inconsistent with the rest of the standard.
Worse, it can reasonably be read as saying a range error occurs if x is positive and a range error occurs if y/x is nonzero and too close to zero.
>
> You could keep atan() the same, repeat atan()'s words and put the sense of Xavier's change to follow the atan() style text so for atan2/atan2pi:
>
> ... occurs if nonzero y/x is too close to zero and x is positive (A)
>
> Or additional change atan()/atanpi() that reflect Xavier's words which I think is a better constructed sentence.
>
> atan:
>
> ... occurs if x is nonzero and too close to zero
>
> atan2:
>
> ... occurs if y/x is nonzero and too close to zero and x is positive (B)
> OR
> ... occurs if x is positive and y/x is nonzero and too close to zero (C)
>
> That also avoids having a double usage of 'if'.
(A) has the advantage that it matches the atan wording without requiring a change to atan.
(C) has the advantage that the "x is positive" condition is stated first, which seems to me the more natural order of thinking about the conditions.
Consider also
... occurs if both x is positive and also nonzero y/x is too close to zero (D)
which has both advantages.
- Jim Thomas
>
> Mc 2c - Damian
> _______________________________________________
> cfp-interest mailing list
> cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest
More information about the cfp-interest
mailing list