strange error in clog
Joseph Myers
josmyers@redhat.com
Fri Apr 25 15:55:50 GMT 2025
On Wed, 23 Apr 2025, Alexander Monakov wrote:
> On Wed, 23 Apr 2025, Paul Zimmermann wrote:
>
> > but then we should also get an error with the original glibc code, since the
> > CORE-MATH code for atan2() should only be used for the imaginary part,
> > and here we get an error for the real part.
>
> Apologies, I should have looked at the code when replying. In the new atan2,
> atan2_accurate clears the underflow flag up front via
> feclearexcept(FE_UNDERFLOW), and never does the corresponding feraiseexcept
> to restore it.
math.h and complex.h functions should never clear already-set exception
flags as part of their API; they should only ever set exception flags that
weren't set on entry, not clear any that were set on entry. Any clearing
done internally as part of the implementation thus needs to be between
feholdexcept and feupdateenv calls (or similar internal interfaces) so
that the overall effect of the function is not to clear any already-raised
exceptions.
--
Joseph S. Myers
josmyers@redhat.com
More information about the Libc-alpha
mailing list