ruby-changes:64873
From: Kenta <ko1@a...>
Date: Thu, 14 Jan 2021 11:01:54 +0900 (JST)
Subject: [ruby-changes:64873] b4ade73974 (master): [ruby/bigdecimal] Explicitly cast uint64_t to double
https://git.ruby-lang.org/ruby.git/commit/?id=b4ade73974 From b4ade73974f7023bff9059737a8ff73fe1c09f40 Mon Sep 17 00:00:00 2001 From: Kenta Murata <mrkn@m...> Date: Thu, 14 Jan 2021 09:23:26 +0900 Subject: [ruby/bigdecimal] Explicitly cast uint64_t to double https://github.com/ruby/bigdecimal/commit/f0d94e6843 diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index f48f3ed..e560c19 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 https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L2704 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; -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/