Source context

Program Rust

POWERS

This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.

27 pub(crate) fn parse_long_mantissa<F: Float>(s: &[u8]) -> BiasedFp {28     const MAX_SHIFT: usize = 60;29     const NUM_POWERS: usize = 19;30     const POWERS: [u8; 19] =31         [0, 3, 6, 9, 13, 16, 19, 23, 26, 29, 33, 36, 39, 43, 46, 49, 53, 56, 59];32 33     let get_shift = |n| {34         if n < NUM_POWERS { POWERS[n] as usize } else { MAX_SHIFT }

Aeneas declaration

The Lean below was mechanically extracted by Aeneas from Rust.

@[global_simps, irreducible]
def num.imp.dec2flt.slow.parse_long_mantissa.POWERS : Array Std.U8 19#usize :=
  Array.make 19#usize [
    0#u8, 3#u8, 6#u8, 9#u8, 13#u8, 16#u8, 19#u8, 23#u8, 26#u8, 29#u8, 33#u8,
    36#u8, 39#u8, 43#u8, 46#u8, 49#u8, 53#u8, 56#u8, 59#u8
    ]
Source details
Declarationnum.imp.dec2flt.slow.parse_long_mantissa.POWERS
Filenum/imp/../../dec2flt/slow.rs
Lines30:4–31:81
Program versionOriginal program