* 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:
nobu 2009-09-02 04:47:39 +00:00
parent dc697b1905
commit 274fa77e3f
2 changed files with 10 additions and 9 deletions

View File

@ -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>
* gc.c (obj_free): fix to free method table (fix memory leak).

15
math.c
View File

@ -25,21 +25,18 @@ extern VALUE rb_to_float(VALUE val);
static void
domain_check(double x, double y, const char *msg)
{
while(1) {
if (errno) {
rb_sys_fail(msg);
}
if (isnan(y)) {
if (isnan(x)) break;
if (!isnan(y)) return;
else if (isnan(x)) return;
else {
if (!errno) {
#if defined(EDOM)
errno = EDOM;
#elif defined(ERANGE)
#else
errno = ERANGE;
#endif
continue;
}
break;
}
rb_sys_fail(msg);
}
static void