File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 2525
2626using namespace std ;
2727
28- void _readconstants (void );
28+ void _readconstants ();
2929
3030#if defined(GEN_CONST)
3131static int cbitsofprecision = 0 ;
@@ -136,13 +136,7 @@ void ChangeConstants(uint32_t radix, int32_t precision)
136136 // in the internal BASEX radix, this is important for length calculations
137137 // in translating from radix to BASEX and back.
138138
139- uint64_t limit = static_cast <uint64_t >(BASEX) / static_cast <uint64_t >(radix);
140- g_ratio = 0 ;
141- for (uint32_t digit = 1 ; digit < limit; digit *= radix)
142- {
143- g_ratio++;
144- }
145- g_ratio += !g_ratio;
139+ g_ratio = static_cast <int32_t >(ceil (log2 (BASEX) / log2 (radix))) - 1 ;
146140
147141 destroyrat (rat_nRadix);
148142 rat_nRadix = i32torat (radix);
You can’t perform that action at this time.
0 commit comments