Program Rust
body
This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.
88 //89 // Trim is only called in `right_shift` and `left_shift`.90 debug_assert!(self.num_digits <= Self::MAX_DIGITS);91 while self.num_digits != 0 && self.digits[self.num_digits - 1] == 0 {92 self.num_digits -= 1;93 }94 }95 96 pub(super) fn round(&self) -> u64 {Aeneas declaration
The Lean below was mechanically extracted by Aeneas from Rust.
@[rust_loop_body]
def num.imp.dec2flt.decimal_seq.DecimalSeq.trim_loop.body
(a : Array Std.U8 768#usize) (i : Std.Usize) :
Result (ControlFlow Std.Usize Std.Usize)
:= do
if i != 0#usize
then
let i1 ← i - 1#usize
let i2 ← Array.index_usize a i1
if i2 = 0#u8
then ok (cont i1)
else ok (done i)
else ok (done i)Other extracted objects at this span
Source details
| Declaration | num.imp.dec2flt.decimal_seq.DecimalSeq.trim_loop.body |
|---|---|
| File | num/imp/../../dec2flt/decimal_seq.rs |
| Lines | 91:8–93:9 |
| Program version | Preparation 2 |