aldanor / fast-float-rust

Super-fast float parser in Rust (now part of Rust core)
https://docs.rs/fast-float
Apache License 2.0
275 stars 20 forks source link

Fix test_random on 32-bit Architectures #20

Closed Alexhuszagh closed 3 years ago

Alexhuszagh commented 3 years ago

Currently, test_random uses the following code for generating the number of iterations:

const N_ITER: usize = 1 << 32;

This overflows if usize has 32-bits or less.

A trivial fix is:

const N_ITER: u64 = 1 << 32;