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 #
Float32.html: inspect class/fields/bits for oneExecFloat.Binary 8 23value.Float32.roundHtml: showFloat64 -> Float32rounding behavior.Float32.compareHtml: side-by-side bit-level comparison.#float32_view,#float32_round_view,#float32_compare_view: command entry points.
Render a bit vector in hexadecimal, preserving the width encoded by its type.
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.
The significand and exponent come from FloatLib's decoded dyadic value; the sign is kept explicit even for zero.
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).
The result is widened to native binary64 for its decimal display. The displayed difference is computed by native binary64 subtraction; it is not an exact-real error certificate.