Floating-point types
- Real floating-point types
- Complex floating-point types
Real floating-point types
- float
- double
- long double
Decimal
floating-point types consist of the following: - _Decimal32
- _Decimal64
- _Decimal128

| Type | Range |
|---|---|
| float | approximately 1.2-38 to 3.438 |
| double, long double | approximately 2.2-308 to 1.8308 |
| _Decimal32 | 0.000001-95 to 9.99999996 |
| _Decimal64 | 0.000000000000001-383 to 9.999999999999999384 |
| _Decimal128 | 0.000000000000000000000000000000001-6143 to 9.9999999999999999999999999999999996144 |
The declarator for a simple floating-point declaration is an identifier. Initialize a simple floating-point variable with a float constant or with a variable or expression that evaluates to an integer or floating-point number.
You can use decimal floating-point types with any of the
operators that are supported for binary floating-point types. However,
you cannot mix decimal floating-point types with generic floating-point
types or complex floating-point types in arithmetic expressions unless
you use explicit conversions. Implicit conversions are applicable
as follows: - Implicit conversions among decimal floating-point types are always supported.
- Implicit conversions between decimal floating-point types and integral types are always supported.
- Implicit conversions between decimal floating-point types and generic floating-point types are supported conditionally. See Floating-point conversions for details.

Complex floating-point types
The XL C/C++ compiler
supports this feature as an IBM extension.
The complex floating-point
type specifiers are as follows:- float _Complex
- double _Complex
- long double _Complex
The representation and alignment requirements of a complex type are the same as an array type containing two elements of the corresponding real type. The real part is equal to the first element; the imaginary part is equal to the second element.
The equality and inequality operators have the same behavior as for real types. None of the relational operators may have a complex type as an operand.
As an extension to C99 and C++03, complex numbers may also
be operands to the unary operators ++ (increment), -- (decrement),
and ~ (bitwise negation).


