diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-02 04:47:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-02 04:47:39 +0000 |
commit | 6f14520a0606c03514fa2ab99caedacedac16e92 (patch) | |
tree | 98027e91f9b84c8f06a773760f0e304b04d2b3b9 /math.c | |
parent | d380745cc34db08ad12b66f11bc0e185df3c180b (diff) |
* math.c (domain_check): simplified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -29,20 +29,17 @@ domain_check(x, msg) double x; const char *msg; { - while(1) { - if (errno) { - rb_sys_fail(msg); - } - if (isnan(x)) { + 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); } |