Float32 #
Float32 viewer widget (executable IEEE-754 backend).
Commands:
#float32_view xrenders anIEEE32Execvalue as bits + fields + basic classification flags.#float32_round_view xshows how a LeanFloat(binary64) rounds toIEEE32Exec(binary32).
These widgets are meant for debugging/teaching, not for proof scripts.
Main definitions #
float32Html: inspect class/fields/bits for oneIEEE32Execvalue.float32RoundHtml: showFloat64 -> Float32rounding behavior.float32CompareHtml: side-by-side bit-level comparison.#float32_view,#float32_round_view,#float32_compare_view: command entry points.
Implementation notes #
- Explicit sign/exp/frac bit pills are easier to read than one long bit string when debugging rounding and special values.
- We include both classification badges and raw field values: in practice users want both the high-level class and exact bit-level evidence.
- We keep this widget purely informational; no arithmetic semantics are changed here.
References #
Tags #
float32, ieee754, rounding, bits, proofwidgets
Render exactly width low-order bits of n as a binary string.
Instances For
Instances For
Classify an IEEE32 value into normal/subnormal/zero/inf/nan variants.
Instances For
Instances For
Render an executable float32 (IEEE32Exec) as HTML.
Instances For
@[implicit_reducible]
Element renderer for IEEE32Exec used by #tensor_view.
Renders the float value, with a tooltip that includes a small classification and the raw bit pattern.
Compare two IEEE32Exec values at the bit level and render the results as HTML.
Instances For
Show how a Lean Float (binary64) rounds to an executable float32 (IEEE32Exec, binary32).