mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
68e111176f
commit
0fdbdfbbda
2 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
Mon Jan 25 11:45:47 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* 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@atdot.net>
|
||||
|
||||
* eval.c, vm.c, vm_eval.c, vm_insnhelper.c: fix issues about
|
||||
|
@ -228,6 +235,7 @@ Sun Jan 17 22:48:44 2010 Akinori MUSHA <knu@iDaemons.org>
|
|||
Sun Jan 17 19:24:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* 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@ruby-lang.org>
|
||||
|
||||
|
|
5
math.c
5
math.c
|
@ -27,7 +27,10 @@ extern VALUE rb_to_float(VALUE val);
|
|||
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 {
|
||||
|
|
Loading…
Reference in a new issue