1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* math.c (math_log, math_log10): should return NaN if x < 0.0

on Cygwin.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2001-03-07 05:43:11 +00:00
parent 93868607a2
commit fc07b3b0ad
3 changed files with 12 additions and 2 deletions

5
math.c
View file

@ -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;