Skip to content

Commit

Permalink
* math.c (domain_check): simplified.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Sep 2, 2009
1 parent dc697b1 commit 274fa77
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Wed Sep 2 13:47:30 2009 Nobuyoshi Nakada <[email protected]>

* math.c (domain_check): simplified.

Wed Sep 2 11:32:24 2009 Koichi Sasada <[email protected]>

* gc.c (obj_free): fix to free method table (fix memory leak).
Expand Down
15 changes: 6 additions & 9 deletions math.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 274fa77

Please sign in to comment.