ISO/IEC TS 18661-4:2025
(Main)Programming languages, their environments, and system software interfaces — Floating-point extensions for C — Part 4: Supplementary functions
Programming languages, their environments, and system software interfaces — Floating-point extensions for C — Part 4: Supplementary functions
This document specifies extensions to programming language C to include functions corresponding to operations specified and recommended in ISO/IEC 60559, but not supported in ISO/IEC 9899:2024 (also referred to as C23).
Langages de programmation, leurs environnements et interfaces du logiciel système — Extensions à virgule flottante pour C — Partie 4: Fonctions supplémentaires
General Information
Relations
Standards Content (Sample)
Technical
Specification
ISO/IEC TS 18661-4
Second edition
Programming languages, their
2025-03
environments, and system software
interfaces — Floating-point
extensions for C —
Part 4:
Supplementary functions
Langages de programmation, leurs environnements et interfaces
du logiciel système — Extensions à virgule flottante pour C —
Partie 4: Fonctions supplémentaires
Reference number
© ISO/IEC 2025
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
© ISO/IEC 2025 – All rights reserved
ii
Contents Page
Foreword .iv
Introduction .v
1 Scope . 1
2 Normative references . 1
3 Terms and definitions . 1
4 Conformance . 1
5 C standard extensions . 2
5.1 Predefined macros .2
5.2 Freestanding implementations . .2
5.3 Headers.2
5.4 Future directions .2
6 Reduction functions . 2
6.1 General .2
6.2 The reduc_sum functions.3
6.3 The reduc_sumabs functions .4
6.4 The reduc_sumsq functions .4
6.5 The reduc_sumprod functions .5
6.6 The scaled_prod functions .5
6.7 The scaled_prodsum functions .6
6.8 The scaled_proddiff functions .7
7 Augmented arithmetic functions . 9
7.1 General .9
7.2 The aug_add functions .9
7.3 The aug_sub functions .11
7.4 The aug_mul functions .11
Bibliography .13
© ISO/IEC 2025 – All rights reserved
iii
Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are
members of ISO or IEC participate in the development of International Standards through technical
committees established by the respective organization to deal with particular fields of technical activity.
ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations,
governmental and non-governmental, in liaison with ISO and IEC, also take part in the work.
The procedures used to develop this document and those intended for its further maintenance are described
in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the different types
of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/
IEC Directives, Part 2 (see www.iso.org/directives or www.iec.ch/members_experts/refdocs).
ISO and IEC draw attention to the possibility that the implementation of this document may involve the
use of (a) patent(s). ISO and IEC take no position concerning the evidence, validity or applicability of any
claimed patent rights in respect thereof. As of the date of publication of this document, ISO and IEC had not
received notice of (a) patent(s) which may be required to implement this document. However, implementers
are cautioned that this may not represent the latest information, which may be obtained from the patent
database available at www.iso.org/patents and https://patents.iec.ch. ISO and IEC shall not be held
responsible for identifying any or all such patent rights.
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and expressions
related to conformity assessment, as well as information about ISO's adherence to the World Trade
Organization (WTO) principles in the Technical Barriers to Trade (TBT) see www.iso.org/iso/foreword.html.
In the IEC, see www.iec.ch/understanding-standards.
This document was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 22, Programming languages, their environments and system software interfaces.
This second edition cancels and replaces the first edition (ISO/IEC TS 18661-4:2015), which has been
technically revised.
The main changes are as follows:
— The specification has been updated to extend ISO/IEC 9899:2024.
— The mathematical functions and constant rounding modes have been removed. These features are now
incorporated into ISO/IEC 9899:2024.
— Functions to support the augmented arithmetic operations specified in IEEE 754-2019 have been added.
— New headers have been added, and all extensions to the header have been removed.
A list of all parts in the ISO 18661 series can be found on the ISO website.
Any feedback or questions on this document should be directed to the user’s national standards
body. A complete listing of these bodies can be found at www.iso.org/members.html and
www.iec.ch/national-committees.
© ISO/IEC 2025 – All rights reserved
iv
Introduction
The IEEE 754-1985 standard for binary floating-point arithmetic was motivated by an expanding diversity
in floating-point data representation and arithmetic, which made writing reliable programs, debugging
and moving programs between systems exceedingly difficult. Now the great majority of systems provide
data formats and arithmetic operations according to IEEE 754. Corresponding versions of IEEE 754 and
ISO/IEC 60559 have equivalent content.
Support for IEEE 754-1985 was added in ISO/IEC 9899:1999 (also referred to as C99), and ISO/IEC 9899:2018
is still based on IEEE 754-1985. However, IEEE 754 underwent a major revision in 2008 and a minor revision
in 2019, which added several new features.
The purpose of the ISO/IEC 18661 series (first published 2014 through 2016) has been to specify C language
support for the new features introduced into IEEE 754 since 1985. Most of the ISO/IEC 18661 series has
been incorporated into ISO/IEC 9899:2024 (also referred to as C23 because major work on this revision was
completed in 2023), which supports all required and most recommended features in IEEE 754-2019.
To supplement the IEEE 754 support in C23, this document specifies two C headers with functions
corresponding to the reduction and augmented arithmetic operations recommended by IEEE 754, but not
included in C23.
The reduction operations perform widely used vector computations involving sums and products, including
scaled products. These operations are allowed to associate in any order, and to evaluate in any wider format.
The augmented arithmetic operations, added in IEEE 754-2019, are versions of operations commonly called
twoSum and twoProduct. These operations can be used to implement arithmetic with extra precision, for
example, for double-double format. In theory, they can also be used to implement efficient reproducible dot
products.
© ISO/IEC 2025 – All rights reserved
v
Technical Specification ISO/IEC TS 18661-4:2025(en)
Programming languages, their environments, and system
software interfaces — Floating-point extensions for C —
Part 4:
Supplementary functions
1 Scope
This document specifies extensions to programming language C to include functions corresponding to
operations specified and recommended in ISO/IEC 60559, but not supported in ISO/IEC 9899:2024 (also
referred to as C23).
2 Normative references
The following documents, in whole or in part, are normatively referenced in this document and are
indispensable for its application. For dated references, only the edition cited applies. For undated references,
the latest edition of the referenced document (including any amendments) applies.
ISO/IEC 9899:2024, Information technology — Programming languages — C
ISO/IEC 60559:2020, Information technology — Microprocessor Systems — Floating-Point arithmetic
3 Terms and definitions
For the purposes of this document, the terms and definitions given in ISO/IEC 9899:2024 and
ISO/IEC 60559:2020 apply.
ISO and IEC maintain terminological databases for use in standardization at the following addresses:
— ISO Online browsing platform: available at https:// www .iso .org/ obp
— IEC Electropedia: available at https:// www .electropedia .org/
4 Conformance
An implementation that meets the requirements for a conforming implementation of C23 may conform to one
or both feature sets (reduction functions and augmented arithmetic) in this document. The implementation
conforms to the reduction functions feature if:
a) it defines __STDC_IEC_60559_BFP__ or __STDC_IEC_60559_DFP__ or both, indicating support for
ISO/IEC 60559 binary or decimal floating-point arithmetic, as specified in C23, Annex F;
b) it defines __STDC_IEC_60559_FUNCS_REDUCTION__ to 202401L and provides the header
specified in this document (Clause 6).
The implementation conforms to the augmented arithmetic feature if:
c) it defines __STDC_IEC_60559_BFP__, indicating support for ISO/IEC 60559 binary floating-point
arithmetic, as specified in C23, Annex F;
d) it defines __STDC_IEC_60559_FUNCS_AUGMENTED_ARITHMETIC__ to 202401L and provides the
header specified in this document (Clause 7).
© ISO/IEC 2025 – All rights reserved
5 C standard extensions
5.1 Predefined macros
The implementation defines one or both of the following macros to indicate conformance to the specification
in this document for support of the corresponding features spe
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.