1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/bigdecimal] Explicitly cast uint64_t to double

https://github.com/ruby/bigdecimal/commit/f0d94e6843
This commit is contained in:
Kenta Murata 2021-01-14 09:23:26 +09:00
parent e129be7592
commit b4ade73974
No known key found for this signature in database
GPG key ID: CEFE8AFB6081B062

View file

@ -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;