[PATCH][BZ #6803] Set errno for scalbln, scalbn
Joseph S. Myers
joseph@codesourcery.com
Fri Apr 25 14:35:00 GMT 2014
On Wed, 23 Apr 2014, Stefan Liebler wrote:
> Hi,
>
> this patch sets errno to ERANGE on overflow and underflow.
> The corresponding tests in libm-test.inc are updated to check for errno, too.
>
> Tested on S390/S390x.
>
> ok to commit?
I don't think this is the best approach. Apart from needing lots of
architecture-specific versions updated (so you'd need to draw the
attention of relevant architecture maintainers to the issue), we already
have a scalbn wrapper that checks for overflow/underflow and sets errno,
in the form of ldexp. So for scalbn it would be most natural to make
scalbn an alias for __ldexp instead of __scalbn; for scalbln you'd need to
add a new wrapper, replacing scalbln being an alias for __scalbln.
(The tests will then need to use ERRNO_PLUS_OFLOW etc. so the expectations
only cover the cases where glibc guarantees errno setting.)
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list