ruby-changes:14558
From: naruse <ko1@a...>
Date: Mon, 25 Jan 2010 11:52:29 +0900 (JST)
Subject: [ruby-changes:14558] Ruby:r26397 (trunk): * math.c (domain_check): ignore errno if y is inf.
naruse 2010-01-25 11:51:16 +0900 (Mon, 25 Jan 2010) New Revision: 26397 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26397 Log: * math.c (domain_check): ignore errno if y is inf. r26335 is because NetBSD 5.0's asin and acos returns 0.0 with errno EDOM. But it breaks Linux whose gamma returns inf with errno ERANGE on. Modified files: trunk/ChangeLog trunk/math.c Index: math.c =================================================================== --- math.c (revision 26396) +++ math.c (revision 26397) @@ -27,7 +27,10 @@ static void domain_check(double x, double y, const char *msg) { - if (!errno) { + if (errno) { + if (isinf(y)) return; + } + else { if (!isnan(y)) return; else if (isnan(x)) return; else { Index: ChangeLog =================================================================== --- ChangeLog (revision 26396) +++ ChangeLog (revision 26397) @@ -1,3 +1,10 @@ +Mon Jan 25 11:45:47 2010 NARUSE, Yui <naruse@r...> + + * math.c (domain_check): ignore errno if y is inf. + r26335 is because NetBSD 5.0's asin and acos returns + 0.0 with errno EDOM. But it breaks Linux whose gamma returns inf + with errno ERANGE on. + Sun Jan 24 22:48:05 2010 Koichi Sasada <ko1@a...> * eval.c, vm.c, vm_eval.c, vm_insnhelper.c: fix issues about @@ -228,6 +235,7 @@ Sun Jan 17 19:24:25 2010 Nobuyoshi Nakada <nobu@r...> * math.c (domain_check): check errno first. + NetBSD 5.0's asin and acos returns 0.0 with errno EDOM. Sun Jan 17 14:24:35 2010 Nobuyoshi Nakada <nobu@r...> -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/