From 441619b73c171bbd808d2bf9125c6bed29fddc74 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 17 Jan 2010 10:24:27 +0000 Subject: [PATCH] * math.c (domain_check): check errno first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ math.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 93a705c628..4a7011329b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Jan 17 19:24:25 2010 Nobuyoshi Nakada + + * math.c (domain_check): check errno first. + Sun Jan 17 14:24:35 2010 Nobuyoshi Nakada * ext/iconv/iconv.c (rb_str_derive): use long. 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