Programming languages, their environments, and system software interfaces — Floating-point extensions for C — Part 5: Supplementary attributes

This document specifies extensions to programming language C to include pragmas corresponding to attributes 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 5: Attributs supplémentaires

General Information

Status
Published
Publication Date
13-Mar-2025
Current Stage
6060 - International Standard published
Start Date
14-Mar-2025
Due Date
14-Mar-2025
Completion Date
14-Mar-2025
Ref Project

Relations

Buy Standard

Technical specification
ISO/IEC TS 18661-5:2025 - Programming languages, their environments, and system software interfaces — Floating-point extensions for C — Part 5: Supplementary attributes Released:14. 03. 2025
English language
20 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)


Technical
Specification
ISO/IEC TS 18661-5
Second edition
Programming languages, their
2025-03
environments, and system software
interfaces — Floating-point
extensions for C —
Part 5:
Supplementary attributes
Langages de programmation, leurs environnements et interfaces
du logiciel système — Extensions à virgule flottante pour C —
Partie 5: Attributs 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 conformance . 2
5.1 Freestanding implementations . .2
5.2 Predefined macros .2
5.3 Standard headers .2
6 Standard pragmas . 2
7 Evaluation formats . 3
7.1 General .3
7.2 Evaluation method pragma .3
7.3 Evaluation method pragma for decimal floating types .4
7.4 Effective evaluation method macros .4
7.5 Evaluation type macros .4
7.6 Evaluation formats for .5
8 Optimization controls . 5
8.1 General .5
8.2 The FP_ALLOW_VALUE_CHANGING_OPTIMIZATION pragma .6
8.3 The FP_ALLOW_ASSOCIATIVE_LAW pragma .6
8.4 The FP_ALLOW_DISTRIBUTIVE_LAW pragma .7
8.5 The FP_ALLOW_MULTIPLY_BY_RECIPROCAL pragma .7
8.6 The FP_ALLOW_ZERO_SUBNORMAL pragma .8
8.7 The FP_ALLOW_CONTRACT_FMA pragma .8
8.8 The FP_ALLOW_CONTRACT_OPERATION_CONVERSION pragma .9
8.9 The FP_ALLOW_CONTRACT pragma .9
9 Reproducibility . 10
9.1 General .10
9.2 The FP_REPRODUCIBLE pragma.10
9.3 Reproducible code .11
10 Alternate exception handling .12
10.1 General . 12
10.2 The FENV_EXCEPT pragma . 13
Bibliography .20

© 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-5:2016), which has been
technically revised.
The main changes are as follows:
— The specification has been updated to extend ISO/IEC 9899:2024.
— Conformance macros have been added to allow conformance to each of the four feature sets (evaluation
formats, optimization controls, reproducibility, and alternate exception handling) independently.
A list of all parts in the ISO/IEC 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.
IEEE 754 defines alternatives for certain attributes of floating-point semantics, and aims to provide, through
programming languages, a means by which a program can specify which of the alternative semantics apply
to a given block of code. The program specification of attributes is constant (fixed at translation time), not
dynamic (changeable at execution time).
The FENV_ROUND and FENV_DEC_ROUND pragmas in C23 provide the rounding direction attributes required by
IEEE 754.
IEEE 754 also recommends other attributes that are not supported in C23, including:
— preferredWidth: evaluation formats for floating-point operations;
— value-changing optimizations: allow/disallow program transformations that can affect floating-point
result values;
— reproducibility: support for getting floating-point result values and exceptions that are exactly
reproducible on other systems;
— alternate exception handling: methods of handling floating-point exceptions.
To supplement the IEEE 754 support in C23, this document provides these recommended attributes by
means of standard pragmas. The pragma parameters represent the alternative semantics. The pragmas are
similar in form to the floating-point pragmas (FENV_ACCESS, FP_CONTRACT, CX_LIMITED_RANGE) that have been
in C since 1999.
© ISO/IEC 2025 – All rights reserved
v
Technical Specification ISO/IEC TS 18661-5:2025(en)
Programming languages, their environments, and system
software interfaces — Floating-point extensions for C —
Part 5:
Supplementary attributes
1 Scope
This document specifies extensions to programming language C to include pragmas corresponding to
attributes specified and recommended in ISO/I
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.