diff options
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -5973,6 +5973,20 @@ rb_ary_sum(int argc, VALUE *argv, VALUE ary) else goto not_float; + if (isnan(f)) continue; + if (isnan(x)) { + f = x; + continue; + } + if (isinf(x)) { + if (isinf(f) && signbit(x) != signbit(f)) + f = NAN; + else + f = x; + continue; + } + if (isinf(f)) continue; + t = f + x; if (fabs(f) >= fabs(x)) c += ((f - t) + x); |