Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just came across this in my work and find it rather baffling:

The format and arithmetic of floating point numbers is
described by several standards. For instance, IEEE 754 is a
widely used standard for the case b=2. It considers, amongst
other things,

single-precision numbers:
- 32 bits: 1 bit sign, 8 bits exponent, 23 bits mantissa, bias 127
- range: approx. ± 3.403 × 10^38
- numbers closest to 0: approx. ± 1.175 × 10^-38

double-precision numbers:
 - 64 bits: 1 bit sign, 11 bits exponent, 52 bits mantissa, bias 1023
 - range: approx. ± 1.798 × 10^308
 - numbers closest to 0: approx. ± 2.225 × 10^-308

I'm not too sure how to interpret all of this so I'll start with a basic question...

What is the main functional difference between single and double precision numbers?

Looking earlier on in my notes I found the following:

The representation of real numbers in computers is based on
the following principle:

Any r ∈ ℝ can be approximated by a floating point number
r ≈ s × m × b^e,


Example: 12.25 = 1 × 0.0001225 × 10^5 [ = 1 × 122.5 × 10^-1]
- s ∈ {1,-1} is the sign,
- m ∈ ℝ is the mantissa,
- b ∈ ℕ is the base and
- e ∈ ℤ is the exponent.

Is there any relation between the two concepts?

share|cite|improve this question
double-precision numbers use more bits, so have more significant digits. This question probably belongs on stackoverflow, by the way. – BlueRaja - Danny Pflughoeft Apr 20 '12 at 14:05
up vote 2 down vote accepted

Yes, the concepts are related. The older section is general, independent of base or number of bits used. However, where you have be you should have b^e or $b^e$. Similarly in the example 105 should be 10^5 and 10-1 should be 10^(-1). Note that it is an approximation-only a subset of the reals can be represented exactly.

The IEEE spec is a particular example. Double precision takes twice the memory and may take longer to operate on, depending on the computer. For single precision, the 23 bits allocated to the mantissa says there are $2^{23} \approx 8$ million values. The 8 bit exponent can range from 0 to 255, but the bias (as in your earlier question) says we consider this to be -127 to 128. The range is the largest and smallest number we can represent, roughly $\pm 2^{128}$ but the gap between two representable numbers is set by the mantissa. Neighboring ones will differ by about one part in $2^{23}$ Double precision has both a larger range and finer granularity. The spec is an attempt to share the available bits to get us the most useful set of numbers available.

share|cite|improve this answer
I've made the updates to the question thanks for the fantastic answer! It makes perfect sense now! – methuselah Apr 20 '12 at 14:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.