From 17fea5626a95864d5a25da76ed2804ab6b7fa70c Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Tue, 18 Jan 2005 20:00:08 +0000 Subject: [PATCH] - 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 --- library/math_log.c | 9 ++++----- library/math_log10.c | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/library/math_log.c b/library/math_log.c index 47a80f6..98d633c 100644 --- a/library/math_log.c +++ b/library/math_log.c @@ -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); } diff --git a/library/math_log10.c b/library/math_log10.c index 0093bc3..532db47 100644 --- a/library/math_log10.c +++ b/library/math_log10.c @@ -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); }