What's the difference between a single precision and double precision floating values?
Asked
Active
Viewed 388 times
-8
-
2Did you try some search first? – Eugene Sh. Feb 12 '20 at 21:15
-
err... the precision. More specifically approximately 6 significant decimal digits vs 15 for single and double precision respectively. – Clifford Feb 12 '20 at 23:36
2 Answers
3
In C, double
has at least as much precision as, and usually more than, float
, and has at least the exponent range of, and usually more than, float
.
The C standard only requires that double
be able to represent all the values of float
: “The set of values of the type float
is a subset of the set of values of the type double
…” (C 3028 6.2.5 10).
In typical common implementations today, float
is represented with 32 bits in the IEEE-754 binary32 format, and double
is represented with 64 bits in the binary64 format.

Eric Postpischil
- 195,579
- 13
- 168
- 312
0
Single precision (float) is stored in 4 bytes (32bits). Double precision (double) is stored in 8 bytes (64bits).

Kedriik
- 331
- 4
- 12