summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authortakkaw <[email protected]>2014-02-15 00:56:35 +0900
committertakkaw <[email protected]>2014-02-15 15:40:51 +0900
commit0a48fb0407065d8ac47e7a97da1f6cce160d7c8d (patch)
treebeee48ae1c39e7fbbff4d23ff4290f8be1ed8864 /src
parent7586d474b585642c1222e618d1bc1caf3e2de27f (diff)
downloadmruby-0a48fb0407065d8ac47e7a97da1f6cce160d7c8d.tar.gz
mruby-0a48fb0407065d8ac47e7a97da1f6cce160d7c8d.zip
modify mrb_to_str() in order to display big float number
Diffstat (limited to 'src')
-rw-r--r--src/numeric.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/numeric.c b/src/numeric.c
index 462faf686..29241d813 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -187,7 +187,8 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo, int max_digit)
}
if (exp >= 100) {
- mrb_raise(mrb, E_RANGE_ERROR, "Too large exponent.");
+ *(c++) = '0' + exp / 100;
+ exp -= exp / 100 * 100;
}
*(c++) = '0' + exp / 10;