This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: bug in logarithm()
Hi Jeff,
On Wed, 17 Oct 2007, Jeff Johnston wrote:
I just found a bug (or at least a discrepancy between doc and src) in
newlib's libm, files mathfp/s_logarithm.c and mathfp/sf_logarithm.c:
There the docs at the beginning of the files say, log(0) returns -Inf, what
the gawk test suite would also expect btw, but clearly the implementation
doesn't return -Inf, but NaN instead.
Martin
A fix has been made. Thanks.
the fix isn't quite right. log(-1) should still return nan. In
particular log(x) should return:
x==nan or x<0.0 : errno=EDOM, return nan
x==0.0 : errno=ERANGE, return -inf
x>0.0 : return log(x)
Martin