summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-14 08:56:42 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-14 08:56:42 +0000
commitcc3d03b196dd3205ac8798db938711598c99d413 (patch)
treeff73da7ce7481cbde029678364c255d58957b89e /numeric.c
parent005953a17b68f11e430a467d48531668b3f8e9b1 (diff)
* 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/trunk@35015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/numeric.c b/numeric.c
index 5eff5ad547..49bfbbaf01 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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