From 923f9573a3f8e607b264575448ca520b3f228863 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 17 Oct 2007 20:14:49 +0000 Subject: 2007-10-17 Jeff Johnston * libm/mathfp/s_logarithm.c: Fix case where input is 0 to return -inf. * libm/mathfp/sf_logarithm.c: Ditto. --- newlib/libm/mathfp/s_logarithm.c | 2 +- newlib/libm/mathfp/sf_logarithm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'newlib/libm') diff --git a/newlib/libm/mathfp/s_logarithm.c b/newlib/libm/mathfp/s_logarithm.c index 3e07949c8..661dd8818 100644 --- a/newlib/libm/mathfp/s_logarithm.c +++ b/newlib/libm/mathfp/s_logarithm.c @@ -104,7 +104,7 @@ _DEFUN (logarithm, (double, int), if (x <= 0.0) { errno = ERANGE; - return (z_notanum.d); + return (-z_infinity.d); } /* Get the exponent and mantissa where x = f * 2^N. */ diff --git a/newlib/libm/mathfp/sf_logarithm.c b/newlib/libm/mathfp/sf_logarithm.c index 224482f13..b8564c14c 100644 --- a/newlib/libm/mathfp/sf_logarithm.c +++ b/newlib/libm/mathfp/sf_logarithm.c @@ -42,7 +42,7 @@ _DEFUN (logarithmf, (float, int), if (x <= 0.0) { errno = ERANGE; - return (z_notanum_f.f); + return (-z_infinity_f.f); } /* Get the exponent and mantissa where x = f * 2^N. */ -- cgit v1.2.3