summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-11 14:36:59 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-11 14:36:59 +0000
commitd8cf7990456ab1d1b96f44b42b6da97b56ec9bc9 (patch)
tree01c5aada10d2c991c87d5006b878ee8f97c53b7f
parent75841340b29c7abcdc1b728ae5fd2ee20104eac4 (diff)
merge revision(s) 20228:
* ext/bigdecimal/bigdecimal.c (VpMidRound): Round method bug pointed by Ryan Platte fixed(Patch to the patch from "NATORI Shin"). [ruby-talk:273360] back ported from 1.9. fix [ruby-core:19791] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@22241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--ext/bigdecimal/bigdecimal.c5
-rw-r--r--version.h8
3 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 785f0fb4c6..aa6f2eab21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,13 @@ Tue Feb 10 19:13:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (search_required): ditto.
+Wed Feb 11 23:36:20 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (VpMidRound): Round method bug
+ pointed by Ryan Platte fixed(Patch to the patch from "NATORI
+ Shin"). [ruby-talk:273360]
+ back ported from 1.9. fix [ruby-core:19791]
+
Mon Feb 9 17:34:55 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_accept): secure fd before accept because if
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 636c0907d6..7400b313a4 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -4345,6 +4345,11 @@ VpMidRound(Real *y, int f, int nf)
nf += y->exponent*((int)BASE_FIG);
exptoadd=0;
if (nf < 0) {
+ /* rounding position too left(large). */
+ if((f!=VP_ROUND_CEIL) && (f!=VP_ROUND_FLOOR)) {
+ VpSetZero(y,VpGetSign(y)); /* truncate everything */
+ return 0;
+ }
exptoadd = -nf;
nf = 0;
}
diff --git a/version.h b/version.h
index 26dd21a384..4d6fed2346 100644
--- a/version.h
+++ b/version.h
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.6"
-#define RUBY_RELEASE_DATE "2009-02-10"
+#define RUBY_RELEASE_DATE "2009-02-11"
#define RUBY_VERSION_CODE 186
-#define RUBY_RELEASE_CODE 20090210
-#define RUBY_PATCHLEVEL 327
+#define RUBY_RELEASE_CODE 20090211
+#define RUBY_PATCHLEVEL 328
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 6
#define RUBY_RELEASE_YEAR 2009
#define RUBY_RELEASE_MONTH 2
-#define RUBY_RELEASE_DAY 10
+#define RUBY_RELEASE_DAY 11
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];