diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-12 04:38:43 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-12 04:38:43 +0000 |
commit | 58fef6226ed517fbefa77ec61eea81cc18f823c1 (patch) | |
tree | 6cf62805bbc519e88a08b1d420605986b2c5d1ed /numeric.c | |
parent | 30fbe3a93110447a79c2a4e0ded3a17d0a5251b0 (diff) |
merge revision(s) 35015:
* numeric.c (flodivmod): must through the same pass if HAVE_FMOD or not.
this is a bugfix of r35013.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -814,18 +814,18 @@ flodivmod(double x, double y, double *divp, double *modp) double div, mod; if (y == 0.0) rb_num_zerodiv(); -#ifdef HAVE_FMOD - mod = fmod(x, y); -#else if((x == 0.0) || (isinf(y) && !isinf(x))) mod = x; else { +#ifdef HAVE_FMOD + mod = fmod(x, y); +#else double z; modf(x/y, &z); mod = x - z * y; - } #endif + } if (isinf(x) && !isinf(y) && !isnan(y)) div = x; else |