
E
APPENDIX
Representing Floating-Point Numbers
IEEE 754, a specification accepted worldwide and used by the Java lan-
guage, defines how to represent floating-point numbers in binary num-
bers. Single-precision floating-point numbers use 32 bits of memory, and
double-precision floating-point numbers use 64 bits.
Here is how single- and double-precision floating-point numbers are rep-
resented:
The leftmost bit stores the sign of the floating-point number; a 0 indicates
a positive number, while a 1 indicates a negative number.
To represent the exponent of the number, which can be positive or nega-
tive, each representation stores a positive, biased exponent, ...