diff --git a/library/changes b/library/changes index ff3f986..43d9972 100644 --- a/library/changes +++ b/library/changes @@ -1,3 +1,8 @@ +- the log() and log10() functions always returned -inf() even if the arguments + was within the valid range for a log() function. Using DBL_EPSILON as the + threshold was not correct as EPSILON is 2.2204460492503131E-16 whereas + values like 1E-200 are still valid double values for a log(). + c.lib 1.202 (16.1.2007) - Added llrint() function contributed by Henning Nielsen Lund. Thank you diff --git a/library/math_log.c b/library/math_log.c index 9dc8197..ffcae4f 100644 --- a/library/math_log.c +++ b/library/math_log.c @@ -1,5 +1,5 @@ /* - * $Id: math_log.c,v 1.9 2006-01-08 12:04:23 obarthel Exp $ + * $Id: math_log.c,v 1.10 2007-11-08 11:23:53 damato Exp $ * * :ts=4 * @@ -244,7 +244,7 @@ log(double x) { double result; - if(x > DBL_EPSILON) + if(x > 0) { result = __log(x); } diff --git a/library/math_log10.c b/library/math_log10.c index bef17ad..0d70020 100644 --- a/library/math_log10.c +++ b/library/math_log10.c @@ -1,5 +1,5 @@ /* - * $Id: math_log10.c,v 1.8 2006-01-08 12:04:23 obarthel Exp $ + * $Id: math_log10.c,v 1.9 2007-11-08 11:23:53 damato Exp $ * * :ts=4 * @@ -186,7 +186,7 @@ log10(double x) { double result; - if(x > DBL_EPSILON) + if(x > 0) { result = __log10(x); }