Re: incorrectly rounded square root

Paul Zimmermann <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
> Great catch, analysis, and fix!
> Now sqrtf rounds correctly on Cygwin!

thank you, I also confirm I now get expected results, after applying Jeff's
patch on top of Newlib 4.1.0:

zimmerma@tomate:/tmp$ gcc -frounding-math -I/tmp/x86_64/include -DNEWLIB -fno-builtin test_sqrt_2.c /tmp/x86_64/lib/libm.a 
zimmerma@tomate:/tmp$ ./a.out 
RNDN: 0x1.ff83fp+63 cw=895 mxcsr=8064
RNDZ: 0x1.ff83eep+63 cw=3967 mxcsr=32672
RNDU: 0x1.ff83fp+63 cw=2943 mxcsr=24480
RNDD: 0x1.ff83eep+63 cw=1919 mxcsr=16288

zimmerma@tomate:/tmp$ gcc -frounding-math -fno-builtin test_sqrt_2.c -lm
zimmerma@tomate:/tmp$ ./a.out 
RNDN: 0x1.ff83fp+63 cw=895 mxcsr=8064
RNDZ: 0x1.ff83eep+63 cw=3967 mxcsr=32672
RNDU: 0x1.ff83fp+63 cw=2943 mxcsr=24480
RNDD: 0x1.ff83eep+63 cw=1919 mxcsr=16288

Paul
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.