Overview
ISO/IEC TS 18661-2:2015 - "Floating‑point extensions for C - Part 2: Decimal floating‑point arithmetic" - is a Technical Specification that extends the C11 language (ISO/IEC 9899:2011) to support decimal floating‑point arithmetic in conformance with ISO/IEC/IEEE 60559:2011 (IEEE 754‑2008). It defines decimal floating types, their characteristics, conversions, arithmetic operations and library support in C. This TS addresses the C language requirements needed to implement IEC 60559 decimal features; it does not cover binary floating‑point (see TS 18661‑1) nor most optional IEC 60559 features.
Key topics and requirements
- Decimal floating types: specification of new decimal types and their properties as they relate to C (characteristics exposed in ).
- Conformance and language integration: rules for C standard conformance, freestanding implementations, predefined macros and required standard headers.
- Arithmetic and conversions: operator and function semantics for decimal arithmetic, conversions between decimal, integer, complex and standard floating types, and usual arithmetic conversions.
- Library interfaces: additions and extensions to standard headers including:
- (characteristics)
- (decimal floating‑point environment and exception flags)
- (decimal mathematics and decimal‑only functions, e.g., quantum/quantum‑exponent and re‑encoding utilities)
- , , (type‑generic math, strtodN/wcstodN, strfromdN)
- Formatted I/O specifiers for decimal types
- Expression evaluation and operation binding: rules for expression transformations and rounding/exception behavior consistent with IEC 60559.
- Scope limits: required behavior that implements IEC 60559 for decimal types; optional IEC 60559 features largely not covered.
Practical applications
- Financial and commercial software where exact decimal representation and predictable rounding matter (accounting, billing, tax calculations).
- Databases, reporting systems and business logic that require decimal currency and fixed‑scale arithmetic.
- Compiler and standard library developers implementing C support for IEEE 754 decimal formats and portable APIs.
- Embedded and safety‑critical systems that need standardized decimal semantics and reproducible numeric results.
- Numerical software testing, porting and conformance verification for systems claiming IEC 60559 decimal support.
Who should use this standard
- Compiler vendors and runtime/library implementers
- Financial software engineers and numerical analysts
- Standards bodies, QA teams, and certification labs
- Embedded systems developers needing predictable decimal behavior
Related standards
- ISO/IEC 9899:2011 (C11) - base C standard
- ISO/IEC/IEEE 60559:2011 (IEEE 754‑2008) - floating‑point arithmetic model (decimal formats)
- ISO/IEC TS 18661‑1 - binary floating‑point extensions for C
- ISO/IEC TR 24732:2009 - superseded by TS 18661‑2
Keywords: ISO/IEC TS 18661-2:2015, decimal floating-point, C11, IEEE 754, IEC 60559, decimal floating types, , , floating-point extensions for C.