mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Added a check against DBL_EPSILON in log() and log10() in place of the
check against 0 that used to be in there. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14807 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_log.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
* $Id: math_log.c,v 1.4 2005-01-18 20:00:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -244,11 +244,10 @@ log(double x)
|
||||
{
|
||||
double result;
|
||||
|
||||
/* ZZZ when do we consider 'x' to be invalid? If it's close
|
||||
* enough to zero or negative. How large is epsilon, and how
|
||||
* do we return minus infinity?
|
||||
/* When do we consider 'x' to be invalid? If it's close
|
||||
* enough to zero or negative.
|
||||
*/
|
||||
if(x > 0.0)
|
||||
if(x > DBL_EPSILON)
|
||||
{
|
||||
result = __log(x);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_log10.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
* $Id: math_log10.c,v 1.3 2005-01-18 20:00:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -186,11 +186,10 @@ log10(double x)
|
||||
{
|
||||
double result;
|
||||
|
||||
/* ZZZ when do we consider 'x' to be invalid? If it's close
|
||||
* enough to zero or negative. How large is epsilon, and how
|
||||
* do we return minus infinity?
|
||||
/* When do we consider 'x' to be invalid? If it's close
|
||||
* enough to zero or negative.
|
||||
*/
|
||||
if(x > 0.0)
|
||||
if(x > DBL_EPSILON)
|
||||
{
|
||||
result = __log10(x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user