mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- 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(). git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15175 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user