Skip to content
Permalink
Browse files

Merge pull request #115 from mwhudson/patch-1

round result of (highest as f64).log(2.0)
  • Loading branch information...
paholg committed Mar 19, 2019
2 parents 992be59 + 0d5196f commit 14a3322d1081fd63d5eb44bf8ab8f90676208228
Showing with 1 addition and 1 deletion.
  1. +1 −1 build/main.rs
@@ -81,7 +81,7 @@ pub fn no_std() {}
fn main() {
let highest: u64 = 1024;

let first2: u32 = (highest as f64).log(2.0) as u32 + 1;
let first2: u32 = (highest as f64).log(2.0).round() as u32 + 1;
let first10: u32 = (highest as f64).log(10.0) as u32 + 1;
let uints = (0..(highest + 1))
.chain((first2..64).map(|i| 2u64.pow(i)))

0 comments on commit 14a3322

Please sign in to comment.
You can’t perform that action at this time.