From 441619b73c171bbd808d2bf9125c6bed29fddc74 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 17 Jan 2010 10:24:27 +0000 Subject: * math.c (domain_check): check errno first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- math.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'math.c') diff --git a/math.c b/math.c index 4d294bfbbb..bc6b7eb333 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 -- cgit v1.2.3