Float32 #
Float32 viewer widget (executable IEEE-754 backend).
Commands:
#float32_view xrenders anExecFloat.Binary 8 23value as bits + fields + basic classification flags.#float32_round_view xshows how a LeanFloat(binary64) rounds toExecFloat.Binary 8 23(binary32).
These widgets are meant for debugging/teaching, not for proof scripts.
Main definitions #
float32Html: inspect class/fields/bits for oneExecFloat.Binary 8 23value.float32RoundHtml: showFloat64 -> Float32rounding behavior.float32CompareHtml: side-by-side bit-level comparison.#float32_view,#float32_round_view,#float32_compare_view: command entry points.
Compact rendering of a 32-bit word for the bit-pattern pills.
Instances For
The 64-bit counterpart, used when a widget shows a binary64 input alongside its float32 result.
Instances For
Render exactly width low-order bits of n as a binary string.
Instances For
One labelled, colour-coded run of bits: the sign, exponent and fraction fields each get one.
Colours are given as rgba overlays rather than solid fills so the widget stays readable against
both
light and dark editor themes.
Instances For
Classify an IEEE32 value into normal/subnormal/zero/inf/nan variants.
Instances For
Render a dyadic rational as ±mantissa * 2^exponent.
This is the exact value of a finite float, written the way Flocq and Coq's Fappli_IEEE write it,
so
what the widget shows can be compared directly against the proofs.
Instances For
Render an executable float32 (ExecFloat.Binary 8 23) as HTML.
Instances For
Element renderer for ExecFloat.Binary 8 23 used by #tensor_view.
Renders the float value, with a tooltip that includes a small classification and the raw bit pattern.
Compare two ExecFloat.Binary 8 23 values at the bit level and render the results as HTML.
Instances For
Show how a Lean Float (binary64) rounds to an executable float32 (ExecFloat.Binary 8 23,
binary32).