Overview
ISO/IEC TS 18661-4:2025 defines supplementary floating-point extensions for the C programming language. Published by ISO and IEC, this technical specification addresses the need for additional floating-point operations in C, corresponding to those defined in IEEE 754 (ISO/IEC 60559), which are not covered in the main C standard, ISO/IEC 9899:2024 (C23). The new extensions focus on advanced mathematical and numerical functions valuable for a wide range of technical, scientific, and engineering applications.
The primary goals of this standard are to enhance numerical reliability, provide precise computation tools, and support improved portability for C programs that require advanced floating-point functionality. By implementing these supplementary functions, both software developers and system architects can ensure consistent behavior and compliance with international floating-point arithmetic standards.
Key Topics
-
Reduction Functions ()
- Provide sum, sum of absolute values, sum of squares, and dot product (sumprod) for arrays.
- Enable accurate and efficient vector computations, supporting both binary and decimal floating-point types.
- Offer scaled product and related operations (scaled_prod, scaled_prodsum, scaled_proddiff) to prevent overflow and underflow during intermediate computations.
-
Augmented Arithmetic Functions ()
- Introduce augmented arithmetic as recommended by IEEE 754, including the well-known twoSum and twoProduct operations.
- Functions return both the computed value and the error term, assisting in double-double arithmetic for increased precision.
-
Conformance and Integration
- Implementations must use specific macros to indicate support:
__STDC_IEC_60559_FUNCS_REDUCTION__ and __STDC_IEC_60559_FUNCS_AUGMENTED_ARITHMETIC__.
- Designed as conditional standard library extensions, ensuring backward compatibility with C23 environments.
-
Precision and Exception Handling
- Functions are specified to minimize intermediate loss of precision.
- Floating-point exceptions are tightly defined for predictable behavior across platforms.
Applications
The supplementary floating-point functions in ISO/IEC TS 18661-4:2025 serve a variety of practical and advanced use cases:
Related Standards
- ISO/IEC 9899:2024 (C23): The core standard for the C programming language, with which these extensions are fully compatible.
- ISO/IEC 60559:2020: Specifies floating-point arithmetic following IEEE 754, forming the basis for the operations and numeric behaviors required by this extension.
- Other ISO/IEC TS 18661 parts: Additional documents in the 18661 series further extend floating-point support in C.
- IEEE 754-2019: The updated international standard for floating-point arithmetic, referenced in the design of the augmented arithmetic operations.
By adhering to ISO/IEC TS 18661-4:2025, developers and implementers of C can create portable, standards-compliant applications that harness advanced floating-point functions for greater accuracy, consistency, and performance in critical computations.