ISO/IEC TS 18661-4
(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
ISO/IEC TS 18661-4:2015 extends programming language C to include functions specified and recommended in ISO/IEC/IEEE 60559:2011.
Langages de programmation, leurs environnements et interfaces du logiciel système — Extensions à virgule flottante pour C — Partie 4: Fonctions supplémentaires
General Information
Relations
Buy Standard
Standards Content (Sample)
FINAL DRAFT
Technical
Specification
ISO/IEC DTS
18661-4
ISO/IEC JTC 1/SC 22
Programming languages, their
Secretariat: ANSI
environments, and system software
Voting begins on:
interfaces — Floating-point
2024-12-06
extensions for C —
Voting terminates on:
2025-01-31
Part 4:
Supplementary functions
RECIPIENTS OF THIS DRAFT ARE INVITED TO SUBMIT,
WITH THEIR COMMENTS, NOTIFICATION OF ANY
RELEVANT PATENT RIGHTS OF WHICH THEY ARE AWARE
AND TO PROVIDE SUPPOR TING DOCUMENTATION.
IN ADDITION TO THEIR EVALUATION AS
BEING ACCEPTABLE FOR INDUSTRIAL, TECHNO-
LOGICAL, COMMERCIAL AND USER PURPOSES, DRAFT
INTERNATIONAL STANDARDS MAY ON OCCASION HAVE
TO BE CONSIDERED IN THE LIGHT OF THEIR POTENTIAL
TO BECOME STAN DARDS TO WHICH REFERENCE MAY BE
MADE IN NATIONAL REGULATIONS.
Reference number
ISO/IEC DTS 18661-4:2024(en) © ISO/IEC 2024
FINAL DRAFT
ISO/IEC DTS 18661-4:2024(en)
Technical
Specification
ISO/IEC DTS
18661-4
ISO/IEC JTC 1/SC 22
Programming languages, their
Secretariat: ANSI
environments, and system software
Voting begins on:
interfaces — Floating-point
extensions for C —
Voting terminates on:
Part 4:
Supplementary functions
RECIPIENTS OF THIS DRAFT ARE INVITED TO SUBMIT,
WITH THEIR COMMENTS, NOTIFICATION OF ANY
RELEVANT PATENT RIGHTS OF WHICH THEY ARE AWARE
AND TO PROVIDE SUPPOR TING DOCUMENTATION.
© ISO/IEC 2024
IN ADDITION TO THEIR EVALUATION AS
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
BEING ACCEPTABLE FOR INDUSTRIAL, TECHNO-
LOGICAL, COMMERCIAL AND USER PURPOSES, DRAFT
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
INTERNATIONAL STANDARDS MAY ON OCCASION HAVE
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
TO BE CONSIDERED IN THE LIGHT OF THEIR POTENTIAL
or ISO’s member body in the country of the requester.
TO BECOME STAN DARDS TO WHICH REFERENCE MAY BE
MADE IN NATIONAL REGULATIONS.
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 Reference number
ISO/IEC DTS 18661-4:2024(en) © ISO/IEC 2024
© ISO/IEC 2024 – All rights reserved
ii
ISO/IEC DTS 18661-4:2024(en)
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 2024 – All rights reserved
iii
ISO/IEC DTS 18661-4:2024(en)
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.
© ISO/IEC 2024 – All rights reserved
iv
ISO/IEC DTS 18661-4:2024(en)
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 TS 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 TS 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 2024 – All rights reserved
v
FINAL DRAFT Technical Specification ISO/IEC DTS 18661-4:2024(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 reduct
...
DRAFT TECHNICAL SPECIFICATION
ISO/IEC DTS 18661-4:2024(en)
ISO/IEC JTC 1/SC 22
Secretariat: ANSI
Second edition
Date: 2024-10-1711-22
Programming languages, their environments, and system software interfaces —
Floating-point extensions for C —
Part 4:
Supplementary functions
Technologies de l’information — Langages de programmation, leurs environnements et interfaces du logiciel
système — Extensions à virgule flottante pour C —
Partie 4: Fonctions supplémentaires
FDIS stage
ISO/IEC DTS 18661-4:2024(:(en)
© ISO/IEC 2024, Published in Switzerland
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 • CP 401
CH-1214 Vernier, Geneva, Switzerland
Tel. +Phone: + 41 22 749 01 11
E-mail: copyright@iso.org
Website: www.iso.org
Published in SwitzerlandFax +41 22 749 09 47
copyright@iso.org
www.iso.org
© ISO/IEC 2024 – All rights reserved
iii
ISO/IEC TSDTS 18661-4:2024(E:(en)
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 . 5
6.5 The reduc_sumprod functions . 5
6.6 The scaled_prod functions . 6
6.7 The scaled_prodsum functions . 7
6.8 The scaled_proddiff functions . 8
7 Augmented arithmetic functions . 11
7.1 General . 11
7.2 The aug_add functions . 11
7.3 The aug_sub functions . 13
7.4 The aug_mul functions . 13
Bibliography . 15
© ISO/IEC 2024 – All rights reserved
iv
© ISO/IEC 2024 – All rights reserved
iv
ISO/IEC DTS 18661-4:2024(:(en)
© ISO/IEC 2024 – All rights reserved
v
ISO/IEC TSDTS 18661-4:2024(E:(en)
Contents
Foreword . vii
Introduction . ix
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 . 3
6.1 General . 3
6.2 The reduc_sum functions . 4
6.3 The reduc_sumabs functions . 5
6.4 The reduc_sumsq functions . 6
6.5 The reduc_sumprod functions . 6
6.6 The scaled_prod functions . 8
6.7 The scaled_prodsum functions . 10
6.8 The scaled_proddiff functions . 14
7 Augmented arithmetic functions . 18
7.1 General . 18
7.2 The aug_add functions . 19
7.3 The aug_sub functions . 21
7.4 The aug_mul functions . 22
Bibliography . 24
© ISO/IEC 2024 – All rights reserved
vi
© ISO/IEC 2024 – All rights reserved
vi
ISO/IEC DTS 18661-4:2024(:(en)
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/directiveswww.iso.org/directives or
www.iec.ch/members_experts/refdocswww.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.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.www.iso.org/iso/foreword.html. In the IEC, see www.iec.ch/understanding-
standardswww.iec.ch/understanding-standards.
This document was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 2722, 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:20— 2024.
— — The mathematical functions and constant rounding modes have been removed. These features are now
incorporated into ISO/IEC 9899:20—. 2024.
— — Functions to support the augmented arithmetic operations specified in IEEE 754-2019 have been
added.
Under preparation. Stage at the time of publication: ISO/DIS 9899:2024.
© ISO/IEC 2024 – All rights reserved
vii
ISO/IEC TSDTS 18661-4:2024(E:(en)
— — 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.
© ISO/IEC 2024 – All rights reserved
viii
© ISO/IEC 2024 – All rights reserved
viii
ISO/IEC DTS 18661-4:2024(:(en)
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 TS 18661 series (first published 2014 through 2016) has been to specify C
language suppor
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.