Re: incorrectly rounded square root

"Maciej W. Rozycki" <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Fri, 4 Jun 2021, Jeff Johnston wrote:

> The compiler is optimizing out the rounding check in ef_sqrt.c, probably
> due to the operation using two constants.

 Have you checked the `-frounding-math' option to GCC?  This piece of code 
(as probably all newlib's math pieces) ought to be built with that option, 
and if that still does not help (which it may well, as noted in the GCC 
manual), then would you please file a bug with GCC, attaching the test 
case discussed here as a reproducer?

 FWIW glibc does use said option, which may be why seemingly equivalent 
code works with glibc but not with newlib.

 HTH,

  Maciej
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.