* math.c (domain_check): simplified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dc697b1905
commit
274fa77e3f
@ -1,3 +1,7 @@
|
|||||||
|
Wed Sep 2 13:47:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* math.c (domain_check): simplified.
|
||||||
|
|
||||||
Wed Sep 2 11:32:24 2009 Koichi Sasada <ko1@atdot.net>
|
Wed Sep 2 11:32:24 2009 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* gc.c (obj_free): fix to free method table (fix memory leak).
|
* gc.c (obj_free): fix to free method table (fix memory leak).
|
||||||
|
15
math.c
15
math.c
@ -25,21 +25,18 @@ extern VALUE rb_to_float(VALUE val);
|
|||||||
static void
|
static void
|
||||||
domain_check(double x, double y, const char *msg)
|
domain_check(double x, double y, const char *msg)
|
||||||
{
|
{
|
||||||
while(1) {
|
if (!isnan(y)) return;
|
||||||
if (errno) {
|
else if (isnan(x)) return;
|
||||||
rb_sys_fail(msg);
|
else {
|
||||||
}
|
if (!errno) {
|
||||||
if (isnan(y)) {
|
|
||||||
if (isnan(x)) break;
|
|
||||||
#if defined(EDOM)
|
#if defined(EDOM)
|
||||||
errno = EDOM;
|
errno = EDOM;
|
||||||
#elif defined(ERANGE)
|
#else
|
||||||
errno = ERANGE;
|
errno = ERANGE;
|
||||||
#endif
|
#endif
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
rb_sys_fail(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user