mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/bigdecimal] Fix length calculation in rb_uint64_convert_to_BigDecimal
https://github.com/ruby/bigdecimal/commit/14e53ed7f6
This commit is contained in:
parent
1eb8eb55c2
commit
ccabf4966f
1 changed files with 1 additions and 2 deletions
|
@ -2697,8 +2697,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 len10 = ceil(LOG10_2 * bit_length(uval));
|
||||
size_t len = roomof(len10, BASE_FIG);
|
||||
const size_t len = (size_t)ceil(log10(uval) / BASE_FIG);
|
||||
|
||||
vp = VpAllocReal(len);
|
||||
vp->MaxPrec = len;
|
||||
|
|
Loading…
Add table
Reference in a new issue