Floating-point arithmetic: Difference between revisions

Content deleted Content added
History: clarification: it must be clear that the rounding is to the destination precision and that there is a single rounding (i.e. there are no intermediate results, these are the exact results that are directly rounded to the destination precision); also warn about the possible wider exponent range (which is explicitly allowed by IEEE 754-1985).
m Floating-point numbers: re-align long equation following typographic conventions, and manually size parens around summation sign (LaTeX default is too big)
Line 73:
When this is stored in memory using the IEEE 754 encoding, this becomes the [[significand]] {{mvar|s}}. The significand is assumed to have a binary point to the right of the leftmost bit. So, the binary representation of π is calculated from left-to-right as follows:
<math display=block>\begin{align}
&\leftbiggl(\sum_{n=0}^{p-1} \text{bit}_n \times 2^{-n}\rightbiggr) \times 2^e \\
=&\qquad{}= &\left(1 \times 2^{-0} + 1 \times 2^{-1} + 0 \times 2^{-2} + 0 \times 2^{-3} + 1 \times2^{-4} + \cdots + 1 \times 2^{-23}\right) \times 2^1 \\[2mu]
&\approxqquad{} &\approx 1.57079637 \times 2 \\[3mu]
&\approxqquad{} &\approx 3.1415927
\end{align}</math><!-- Ensure correct rounding by taking one more digit for the intermediate decimal approximation. -->