bug in ldexp with directed rounding
Paul Zimmermann
Paul.Zimmermann@inria.fr
Tue Feb 3 07:32:57 GMT 2026
Hi Craig,
> The test case is flawed in that it does not check the return value of
> fesetround() (or FE_ALL_EXCEPT). On the majority of platforms fenv is not
> supported, so the results are as expected and valid. It is not stated what
> platform the test case results are from, but guessing x86_64, that is among
> the unsupported.
indeed if I put the return value of fesetround into "int ret":
zimmerma@thym:~/svn/tbd/20/src/binary64$ ./a.out
x=0x0.0000000000001p-1022
FE_TONEAREST: y=0x0p+0 ret=0
FE_TOWARDZERO: y=0x0p+0 ret=22
FE_UPWARD: y=0x0p+0 ret=22
FE_DOWNWARD: y=0x0p+0 ret=22
thus only FE_TONEAREST is supported on x86_64.
Is there some cfarm machine (https://portal.cfarm.net/machines/list/)
where fenv is supported?
Paul
More information about the Newlib
mailing list