summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--numeric.c8
-rw-r--r--test/ruby/test_float.rb2
-rw-r--r--version.h2
4 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index d08b82b7f2..55081076db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 12 13:36:32 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * numeric.c (flodivmod): must through the same pass if HAVE_FMOD or not.
+ this is a bugfix of r35013.
+
Fri Oct 12 13:28:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* io.c (rb_cloexec_fcntl_dupfd): get rid of compile error on windows.
diff --git a/numeric.c b/numeric.c
index 497b93b85d..56f08bc237 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
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index 440fd39bbe..d2cee75433 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -196,7 +196,7 @@ class TestFloat < Test::Unit::TestCase
end
def test_modulo3
- bug6048 = '[ruby-core:42726]'
+ bug6044 = '[ruby-core:42726]'
assert_equal(4.2, 4.2.send(:%, Float::INFINITY))
assert_equal(4.2, 4.2 % Float::INFINITY)
assert_is_minus_zero(-0.0 % 4.2)
diff --git a/version.h b/version.h
index 492e9dd28e..6c1dda48d0 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 280
+#define RUBY_PATCHLEVEL 281
#define RUBY_RELEASE_DATE "2012-10-12"
#define RUBY_RELEASE_YEAR 2012