Names specified here
Name Description Notes Source Availability
CMPLX() Create constant of type double complex ? M (·) <complex.h> C11
DBL_DECIMAL_DIG Representable decimal digits in any real floating-point type L M <float.h> C89 C90 C95 C99 C11
DBL_DIG Decimal digits of precision of double L M <float.h> C89 C90 C95 C99 C11
DBL_EPSILON Smallest x of type double such that 1.0 + x != 1.0 L M <float.h> C89 C90 C95 C99 C11
DBL_HAS_SUBNORM Determinant whether double has subnormal values L M <float.h> C11
DBL_MANT_DIG Number of base-FLT_RADIX digits in mantissa of double L M <float.h> C89 C90 C95 C99 C11
DBL_MAX Maximum value of double L M <float.h> C89 C90 C95 C99 C11
DBL_MAX_10_EXP Maximum integral base-10 exponent yielding double L M <float.h> C89 C90 C95 C99 C11
DBL_MAX_EXP One plus maximum integral exponent of base FLT_RADIX yielding double L M <float.h> C89 C90 C95 C99 C11
DBL_MIN Minimum normalized value of double L M <float.h> C89 C90 C95 C99 C11
DBL_MIN_10_EXP Minimum integral base-10 exponent yielding normalized double L M <float.h> C89 C90 C95 C99 C11
DBL_MIN_EXP One plus minimum integral exponent of base FLT_RADIX yielding normalized double L M <float.h> C89 C90 C95 C99 C11
DBL_TRUE_MIN Minimum positive value of double L M <float.h> C11
double ‘Double-precision’ floating-point type L T Native C89 C90 C95 C99 C11
double _Complex ‘Double-precision’ floating-point complex type L ? T Native C99 C11
double _Imaginary ‘Double-precision’ floating-point imaginary type L ? T Native C99 C11
double complex ‘Double-precision’ floating-point complex type ? T <complex.h> C99 C11
double imaginary ‘Double-precision’ floating-point imaginary type ? T <complex.h> C99 C11

double is intended to be a native real floating-point type of a natural size, capable of representing a practical range of real numbers. (long double is usually a larger and more capable type, while float is usually less capable but more compact.) A floating-point constant of type double is not suffixed.

Various macros in <float.h> describe the capabilities of double. It supports DBL_DIG decimal digits of precision, or DBL_MANT_DIG digits in the native base FLT_RADIX.

double has a range of ±DBL_MAX. The smallest positive non-zero value it can take is DBL_TRUE_MIN, which could be subnormal. The smallest positive normalized value it can take is DBL_MIN.

From C11, if subnormal values are possible, DBL_HAS_SUBNORM expands to 1. If not, it expends to 0. If it is undeterminable, it expands to -1.

DBL_MIN_10_EXP is the lowest integer x that you can give to pow(10.0, x) and still get a normalized value. DBL_MAX_10_EXP is the highest integer x that you can give to pow(10.0, x) and still get a normalized value.

DBL_MIN_EXP is the lowest integer x that you can give to pow(FLT_RADIX, x - 1) and still get a normalized value. DBL_MAX_EXP is the highest integer x that you can give to pow(FLT_RADIX, x - 1) and still get a normalized value. DBL_EPSILON is the smallest value you can add to 1.0 to yield something other than 1.0.

DBL_DECIMAL_DIG is the number of decimal digits that double can retain without rounding error.

From C99, if __STDC_NO_COMPLEX__ is defined, double _Complex is a complex floating-point type that has the same representation as an array of two doubles, the first being the real part, and the second the imaginary part, of the complex number it represents. If imaginary is defined in <complex.h>, double _Imaginary is an imaginary floating-point type that has the same representation as a double. double imaginary and double complex are alternative names for these types, available in <complex.h>.

#include <complex.h>
double complex CMPLX(double re, double im);

The macro CMPLX expands to a constant expression suitable to initialize a double complex with static or thread-local storage, with a value re + I * im, a complex number with a real component re and an imaginary component im, provided re and im are similarly suitable.

If CMPLX is unavailable, a portable implementation could be:

#define CMPLX(RE, IM) \
  (*(double _Complex *) (double[2]) { (RE), (IM) })

This information derives from a comp.std.c thread in May 2009.

TODO: This needs checking.

A value of type double complex can be split into cartesian co-ordinates with creal and cimag, or into polar co-ordinates with carg and cabs.


CHaR
Sitemap Supported
Site format updated 2024-06-05T22:37:07.391+0000
Data updated 1970-01-01T00:00:00.000+0000
Page updated 2022-06-17T21:43:05.000+0000