"1 + -1" when rounding to -inf

David Miller davem@davemloft.net
Mon Apr 21 18:51:00 GMT 2014


[ Resending this as I got the libc-alpha address wrong the first time
  around. ]

What is the result of this supposed to be?  Is it "-0.0"?

Here's why I'm asking.  log1p_downward(-1) is failing on sparc for
"long double" giving INF instead of -INF.

I wrote a simple test program and, with FE_DOWNWARD, the sequence is:

-1 + 1 == -0.0L

-1L / -0.0L == INF

Any insight into what should be happening here would be appreciated.



More information about the Libc-alpha mailing list