Program Rust
N_POWERS_OF_FIVE
This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.
8 9 pub(super) const SMALLEST_POWER_OF_FIVE: i32 = -342;10 pub(super) const LARGEST_POWER_OF_FIVE: i32 = 308;11 pub(super) const N_POWERS_OF_FIVE: usize =12 (LARGEST_POWER_OF_FIVE - SMALLEST_POWER_OF_FIVE + 1) as usize;13 14 // Use static to avoid long compile times: Rust compiler errors15 // can have the entire table compiled multiple times, and thenAeneas declaration
The Lean below was mechanically extracted by Aeneas from Rust.
@[global_simps, irreducible]
def num.imp.dec2flt.table.N_POWERS_OF_FIVE : Result Std.Usize := do
let i ←
num.imp.dec2flt.table.LARGEST_POWER_OF_FIVE -
num.imp.dec2flt.table.SMALLEST_POWER_OF_FIVE
let i1 ← i + 1#i32
ok (IScalar.hcast .Usize i1)Source details
| Declaration | num.imp.dec2flt.table.N_POWERS_OF_FIVE |
|---|---|
| File | num/imp/../../dec2flt/table.rs |
| Lines | 11:0–12:66 |
| Program version | Original program |