summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-02 04:47:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-02 04:47:39 +0000
commit6f14520a0606c03514fa2ab99caedacedac16e92 (patch)
tree98027e91f9b84c8f06a773760f0e304b04d2b3b9 /math.c
parentd380745cc34db08ad12b66f11bc0e185df3c180b (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.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/math.c b/math.c
index 9a6d459797..d8a0230fc5 100644
--- a/math.c
+++ b/math.c
@@ -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);
}