Skip to content

Commit

Permalink
Use hard-coded values in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
paholg committed Dec 25, 2021
1 parent 500ef75 commit 5ea9604
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ pub fn no_std() {}
fn main() {
let highest: u64 = 1024;

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;
// Use hardcoded values to avoid issues with cross-compilation.
// See https://github.com/paholg/typenum/issues/162
let first2: u32 = 11; // (highest as f64).log(2.0).round() as u32 + 1;
let first10: u32 = 4; // (highest as f64).log(10.0) as u32 + 1;
let uints = (0..(highest + 1))
.chain((first2..64).map(|i| 2u64.pow(i)))
.chain((first10..20).map(|i| 10u64.pow(i)));
Expand Down

0 comments on commit 5ea9604

Please sign in to comment.