Re: bug in ldexp with directed rounding

Paul Zimmermann <[email protected]> Tue, 03 Feb 2026 08:32:57 +0100
Newsgroups gmane.comp.lib.newlib
Message-ID <p9u05x8egu3a.fsf@thym>
       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