summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-17 10:24:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-17 10:24:27 +0000
commit441619b73c171bbd808d2bf9125c6bed29fddc74 (patch)
treef097bfa601c0ee63ced2d4279b27c781e2411fec /math.c
parent12278f0b70e2a395817653e8b40dbcef0f94bed6 (diff)
* math.c (domain_check): check errno first.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r--math.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/math.c b/math.c
index 4d294bf..bc6b7eb 100644
--- a/math.c
+++ b/math.c
@@ -27,10 +27,10 @@ extern VALUE rb_to_float(VALUE val);
static void
domain_check(double x, double y, const char *msg)
{
- if (!isnan(y)) return;
- else if (isnan(x)) return;
- else {
- if (!errno) {
+ if (!errno) {
+ if (!isnan(y)) return;
+ else if (isnan(x)) return;
+ else {
#if defined(EDOM)
errno = EDOM;
#else