Floating point toolkit
Convert values between number bases, normalise binary numbers, build a custom floating-point format, or inspect IEEE 754 single and double precision. The working is shown explicitly.
Base 2
1011.101 exactBase 8
13.5 exactBase 10
11.625 exactBase 16
B.A exactLaTeX source
\documentclass[11pt]{article}
\usepackage[a4paper,margin=2.2cm]{geometry}
\usepackage{amsmath,amssymb}
\setlength{\parindent}{0pt}
\begin{document}
\section*{Floating point toolkit}
\section*{Base conversion}
Base 2: \texttt{1011.101}
Base 8: \texttt{13.5}
Base 10: \texttt{11.625}
Base 16: \texttt{B.A}
\end{document}
Bases and normalisation
Binary, octal, denary and hexadecimal conversions use exact integer and fractional arithmetic. Terminating expansions are shown in full; recurring expansions are marked with parentheses around the repeating block, and a truncated expansion ends with an ellipsis.
Normalising writes a binary value as ±1.xxxx × 2e. The sign, exponent and stored mantissa are reported separately.
Floating-point formats
A custom format uses one sign bit, a biased exponent and an implied leading 1. The bias is 2e−1 − 1, and the reserved top exponent represents infinity or NaN.
IEEE 754 uses 8 exponent bits and 23 fraction bits for single precision, or 11 exponent bits and 52 fraction bits for double precision. The toolkit reports the exact bit fields and the decoded value.
Export
Each result includes a export with the conversions, normalised form or bit fields, so the working can be copied or downloaded as a .tex file.