Double (C++)

C++ double is the default floating point data type. Unlike many other languages C++ doesn't use float as the default floating point. The name is somewhat misleading, because double is not guaranteed by standards to provide twice the precision of float nor to take twice as many bytes of memory for storage. The standard defines double as having not less precision than float, which is a common theme in C++ standards.

It is not possible to enumerate double values, and thus it cannot be used in constructs like.

Literals
Literals with a floating point or exponent are double. For example:,  ,

Double can store positive infinity, negative infinity, and NaN (not a number). NaN is generated when the result is mathematically ambiguous or impossible to determine, for example 0÷0.

Characteristics
The library consists of the following constants describing the behaviour of float
 * FLT_RADIX &mdash; base of the floating point numbers.
 * DBL_MANT_DIG &mdash; number of mantissa digits.
 * DBL_DIG &mdash; number of significant digits that can be stored.
 * DBL_MIN_EXP &mdash; minimum negative exponent.
 * DBL_MAX_EXP &mdash; maximum positive exponent.
 * DBL_MIN_10_EXP &mdash; minimum base-10 negative exponent that can be transformed into a valid double
 * DBL_MAX_10_EXP &mdash; maximum base-10 positive exponent that can be transformed into a valid double
 * DBL_EPSILON &mdash; the difference from 1.0 to the smallest possible value that is greater than 1.0
 * DBL_MIN &mdash; the smallest possible value that is greater than 0.0

Other C++ data types storing floating point numbers

 * float least precise floating point data type
 * long double not less precise than double