Native signed integers to binary floating point #
ofInt_conversion_spec connects Lean's integer constructor to the complete binary conversion
specification, including the selected word and rounding status. Fixed-width native conversions
then agree with ExecDType.intToFloat at nearest-even rounding.
Lean defines the signed native casts through its logical floating-point models and exposes
ofNat, ofInt, Int.toFloat, Int.toFloat32, and named
floating-point constants. The proofs here use those signed-cast definitions.
Lean's integer constructor gives the roundRat result for the integer as a rational.
Lean's shared integer conversion satisfies the complete nearest-even conversion specification.
The pack adapter may return the model word or store it in a configured carrier.
Lean's integer constructor agrees with fixed-width ExecDType.intToFloat at nearest-even.
Int8.toFloat agrees with nearest-even ExecDType.intToFloat into binary64.
Int16.toFloat agrees with nearest-even ExecDType.intToFloat into binary64.
Int32.toFloat agrees with nearest-even ExecDType.intToFloat into binary64.
Int64.toFloat agrees with nearest-even ExecDType.intToFloat into binary64.
ISize.toFloat uses the platform's signed width and binary64 nearest-even rounding.
Int8.toFloat32 agrees with nearest-even ExecDType.intToFloat into binary32.
Int16.toFloat32 agrees with nearest-even ExecDType.intToFloat into binary32.
Int32.toFloat32 agrees with nearest-even ExecDType.intToFloat into binary32.
Int64.toFloat32 agrees with nearest-even ExecDType.intToFloat into binary32.
ISize.toFloat32 uses the platform's signed width and binary32 nearest-even rounding.