We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e013911 commit 5bf04fdCopy full SHA for 5bf04fd
src/lib.rs
@@ -98,7 +98,7 @@ fn count_decimal_digits(int: &BigInt) -> u64 {
98
return 1;
99
}
100
// guess number of digits based on number of bits in UInt
101
- let mut digits = (int.bits() as f64 / 3.3219280949) as u64;
+ let mut digits = (int.bits() as f64 / LOG2_10) as u64;
102
let mut num = ten_to_the(digits);
103
while *int >= num {
104
num *= 10u8;
@@ -120,7 +120,7 @@ fn get_rounding_term(num: &BigInt) -> u8 {
120
return 0;
121
122
123
- let digits = (num.bits() as f64 / 3.3219280949) as u64;
+ let digits = (num.bits() as f64 / LOG2_10) as u64;
124
let mut n = ten_to_the(digits);
125
126
// loop-method
0 commit comments