From d416184771dca2212429590d3392bb9cdaec5ff7 Mon Sep 17 00:00:00 2001 From: eban Date: Wed, 7 Mar 2001 05:43:11 +0000 Subject: * math.c (math_log, math_log10): should return NaN if x < 0.0 on Cygwin. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- math.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'math.c') diff --git a/math.c b/math.c index a676abf45..9b28ddbf6 100644 --- a/math.c +++ b/math.c @@ -64,6 +64,11 @@ math_exp(obj, x) return rb_float_new(exp(RFLOAT(x)->value)); } +#if defined __CYGWIN__ +#define log(x) ((x) < 0.0 ? 0.0 / 0.0 : log(x)) +#define log10(x) ((x) < 0.0 ? 0.0 / 0.0 : log10(x)) +#endif + static VALUE math_log(obj, x) VALUE obj, x; -- cgit