Program Rust
trim_loop
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]
def num.imp.dec2flt.decimal_seq.DecimalSeq.trim_loop
(i : Std.Usize) (a : Array Std.U8 768#usize) : Result Std.Usize := do
loop
(fun i1 => num.imp.dec2flt.decimal_seq.DecimalSeq.trim_loop.body a i1)
iOperations used here
Other extracted objects at this span
Source details
| Declaration | num.imp.dec2flt.decimal_seq.DecimalSeq.trim_loop |
|---|---|
| File | num/imp/../../dec2flt/decimal_seq.rs |
| Lines | 91:8–93:9 |
| Program version | Original program |