Next: Hex Floats, Previous: Complex, Up: C Extensions

### 5.10 Decimal Floating Types

As an extension, the GNU C compiler supports decimal floating types as defined in the N1176 draft of ISO/IEC WDTR24732. Support for decimal floating types in GCC will evolve as the draft technical report changes. Calling conventions for any target might also change. Not all targets support decimal floating types.

The decimal floating types are `_Decimal32`, `_Decimal64`, and `_Decimal128`. They use a radix of ten, unlike the floating types `float`, `double`, and `long double` whose radix is not specified by the C standard but is usually two.

Support for decimal floating types includes the arithmetic operators add, subtract, multiply, divide; unary arithmetic operators; relational operators; equality operators; and conversions to and from integer and other floating types. Use a suffix ``df`' or ``DF`' in a literal constant of type `_Decimal32`, ``dd`' or ``DD`' for `_Decimal64`, and ``dl`' or ``DL`' for `_Decimal128`.

GCC support of decimal float as specified by the draft technical report is incomplete:

- Translation time data type (TTDT) is not supported.
- Characteristics of decimal floating types are defined in header file `decfloat.h` rather than `float.h`.
- When the value of a decimal floating type cannot be represented in the integer type to which it is being converted, the result is undefined rather than the result value specified by the draft technical report.

Types `_Decimal32`, `_Decimal64`, and `_Decimal128` are supported by the DWARF2 debug information format.