Program Rust
from_u64_bits
This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.
270 271 impl FloatExt for f32 {272 #[inline]273 fn from_u64_bits(v: u64) -> Self {274 f32::from_bits((v & 0xFFFFFFFF) as u32)275 }276 277 // This is the upstream default after substituting `Self::Int = u32`;278 // concreteness is needed only because Charon cannot resolve the genericAeneas declaration
The Lean below was mechanically extracted by Aeneas from Rust.
def F32.Insts.Dec2flt_modelNumImpTraitsFloatExtU32.from_u64_bits
(v : Std.U64) : Result F32 := do
let i ← lift (v &&& 4294967295#u64)
let i1 ← lift (UScalar.cast .U32 i)
core.f32.F32.from_bits i1Operations used here
Source details
| Declaration | F32.Insts.Dec2flt_modelNumImpTraitsFloatExtU32.from_u64_bits |
|---|---|
| File | num/imp/../../traits.rs |
| Lines | 273:4–275:5 |
| Program version | Preparation 1 |