summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenta Murata <mrkn@mrkn.jp>2021-01-14 09:23:26 +0900
committerKenta Murata <mrkn@mrkn.jp>2021-01-14 10:20:47 +0900
commitb4ade73974f7023bff9059737a8ff73fe1c09f40 (patch)
treedeef56dd485bb502806b39860d39777ff20590d3
parente129be7592cd0551f45f6c6aa2faf88bbe697f66 (diff)
[ruby/bigdecimal] Explicitly cast uint64_t to double
https://github.com/ruby/bigdecimal/commit/f0d94e6843
-rw-r--r--ext/bigdecimal/bigdecimal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index f48f3edb18e..e560c19c063 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -2704,7 +2704,7 @@ rb_uint64_convert_to_BigDecimal(uint64_t uval, RB_UNUSED_VAR(size_t digs), int r
vp->frac[0] = (DECDIG)uval;
}
else {
- const size_t len = (size_t)ceil(log10(uval) / BASE_FIG);
+ const size_t len = (size_t)ceil(log10((double)uval) / BASE_FIG);
vp = VpAllocReal(len);
vp->MaxPrec = len;