TorchLean API

FloatLib.Floats.Formats.IEEE754.Native.Integer.FromInt

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.