Information technology -- Microprocessor Systems -- Floating-Point arithmetic

This standard specifies interchange and arithmetic formats and methods for binary and decimal floating-point arithmetic in computer programming environments. This standard specifies exception conditions and their default handling. An implementation of a floating-point system conforming to this standard may be realized entirely in software, entirely in hardware, or in any combination of software and hardware. For operations specified in the normative part of this standard, numerical results and exceptions are uniquely determined by the values of the input data, sequence of operations, and destination formats, all under user control.

Technologies de l'information -- Systèmes de microprocesseurs -- Arithmétique flottante

General Information

Status
Published
Publication Date
03-Jun-2020
Current Stage
6000 - International Standard under publication
Start Date
04-Jun-2020
Ref Project

RELATIONS

Buy Standard

Standard
ISO/IEC 60559:2020 - Information technology -- Microprocessor Systems -- Floating-Point arithmetic
English language
74 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (sample)

ISO/IEC 60559
Edition 2.0 2020-05
IEEE Std 754
INTERNATIONAL
STANDARD
Floating-point arithmetic
ISO/IEC 60559:2020-05(en) IEEE Std 754-2019
---------------------- Page: 1 ----------------------
THIS PUBLICATION IS COPYRIGHT PROTECTED
Copyright © 2019 IEEE

All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form

or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from

ISO, IEC or IEEE at the respective address given below.

ISO copyright office IEC Central Office Institute of Electrical and Electronics Engineers, Inc.

Case postale 56 3, rue de Varembé 3 Park Avenue
CH-1211 Geneva 20 CH-1211 Geneva 20 New York, NY 10016-5997
Switzerland Switzerland United States of America
Tel.: +41 22 749 01 11 Tel.: +41 22 919 02 11 stds.info@ieee.org
copyright@iso.org info@iec.ch www.ieee.org
www.iso.org www.iec.ch
About the IEC

The International Electrotechnical Commission (IEC) is the leading global organization that prepares and publishes

International Standards for all electrical, electronic and related technologies.
About IEC publications

The technical content of IEC publications is kept under constant review by the IEC. Please make sure that you have the

latest edition, a corrigendum or an amendment might have been published.

IEC publications search - webstore.iec.ch/advsearchform Electropedia - www.electropedia.org

The advanced search enables to find IEC publications by a The world's leading online dictionary on electrotechnology,

variety of criteria (reference number, text, technical containing more than 22 000 terminological entries in English

committee,…). It also gives information on projects, replaced and French, with equivalent terms in 16 additional languages.

and withdrawn publications. Also known as the International Electrotechnical Vocabulary

(IEV) online.
IEC Just Published - webstore.iec.ch/justpublished

Stay up to date on all new IEC publications. Just Published IEC Glossary - std.iec.ch/glossary

details all new publications released. Available online and 67 000 electrotechnical terminology entries in English and

once a month by email. French extracted from the Terms and definitions clause of

IEC publications issued between 2002 and 2015. Some

IEC Customer Service Centre - webstore.iec.ch/csc entries have been collected from earlier publications of IEC

If you wish to give us your feedback on this publication or TC 37, 77, 86 and CISPR.

need further assistance, please contact the Customer Service
Centre: sales@iec.ch.
---------------------- Page: 2 ----------------------
ISO/IEC 60559
Edition 2.0 2020-05
IEEE Std 754™
INTERNATIONAL
STANDARD
Floating-point arithmetic
INTERNATIONAL
ELECTROTECHNICAL
COMMISSION
ICS 35.200 ISBN 978-2-8322-8178-9

Warning! Make sure that you obtained this publication from an authorized distributor.

---------------------- Page: 3 ----------------------
ISO/IEC 60559:2020(E)
IEEE Std 754-2019
– 4 –
IEEE Std 754-2019
IEEE Standard for Floating-Point Arithmetic
Contents

1. Overview...................................................................................................................................................11

1.1 Scope................................................................................................................................................11

1.2 Purpose.............................................................................................................................................11

1.3 Inclusions..........................................................................................................................................11

1.4 Exclusions........................................................................................................................................11

1.5 Programming environment considerations......................................................................................12

1.6 Word usage.......................................................................................................................................12

2. Definitions, abbreviations, and acronyms.................................................................................................13

2.1 Definitions........................................................................................................................................13

2.2 Abbreviations and acronyms............................................................................................................15

3. Floating-point formats...............................................................................................................................16

3.1 Overview..........................................................................................................................................16

3.2 Specification levels...........................................................................................................................17

3.3 Sets of floating-point data................................................................................................................17

3.4 Binary interchange format encodings..............................................................................................19

3.5 Decimal interchange format encodings............................................................................................20

3.6 Interchange format parameters.........................................................................................................23

3.7 Extended and extendable precisions................................................................................................25

4. Attributes and rounding.............................................................................................................................26

4.1 Attribute specification......................................................................................................................26

4.2 Dynamic modes for attributes..........................................................................................................26

4.3 Rounding-direction attributes...........................................................................................................27

5. Operations..................................................................................................................................................29

5.1 Overview..........................................................................................................................................29

5.2 Decimal exponent calculation..........................................................................................................30

5.3 Homogeneous general-computational operations............................................................................31

5.4 formatOf general-computational operations....................................................................................33

5.5 Quiet-computational operations.......................................................................................................35

5.6 Signaling-computational operations.................................................................................................37

5.7 Non-computational operations.........................................................................................................37

5.8 Details of conversions from floating-point to integer formats.........................................................39

5.9 Details of operations to round a floating-point datum to integral value..........................................41

5.10 Details of totalOrder predicate.......................................................................................................42

5.11 Details of comparison predicates...................................................................................................43

5.12 Details of conversion between floating-point data and external character sequences...................44

6. Infinity, NaNs, and sign bit.......................................................................................................................48

6.1 Infinity arithmetic.............................................................................................................................48

6.2 Operations with NaNs......................................................................................................................48

6.3 The sign bit.......................................................................................................................................50

7. Exceptions and default exception handling...............................................................................................51

7.1 Overview: exceptions and flags.......................................................................................................51

7.2 Invalid operation..............................................................................................................................52

7.3 Division by zero...............................................................................................................................53

7.4 Overflow...........................................................................................................................................53

7.5 Underflow.........................................................................................................................................53

7.6 Inexact..............................................................................................................................................54

8. Alternate exception handling attributes.....................................................................................................55

8.1 Overview..........................................................................................................................................55

8.2 Resuming alternate exception handling attributes...........................................................................55

8.3 Immediate and delayed alternate exception handling attributes......................................................56

Copyright © 2019 IEEE. All rights reserved.
---------------------- Page: 4 ----------------------
ISO/IEC 60559:2020(E)
IEEE Std 754-2019 – 5 –
IEEE Std 754-2019
IEEE Standard for Floating-Point Arithmetic

9. Recommended operations.........................................................................................................................58

9.1 Conforming language- and implementation-defined operations.....................................................58

9.2 Additional mathematical operations.................................................................................................58

9.3 Dynamic mode operations................................................................................................................65

9.4 Reduction operations........................................................................................................................66

9.5 Augmented arithmetic operations....................................................................................................68

9.6 Minimum and maximum operations................................................................................................69

9.7 NaN payload operations...................................................................................................................71

10. Expression evaluation..............................................................................................................................72

10.1 Expression evaluation rules............................................................................................................72

10.2 Assignments, parameters, and function values..............................................................................72

10.3 preferredWidth attributes for expression evaluation......................................................................73

10.4 Literal meaning and value-changing optimizations.......................................................................74

11. Reproducible floating-point results.........................................................................................................75

Annex A (informative) Bibliography.............................................................................................................77

Annex B (informative) Program debugging support......................................................................................79

Annex C (informative) List of operations......................................................................................................81

Annex D (informative) IEEE list of participants............................................................................................83

Copyright © 2019 IEEE. All rights reserved.
---------------------- Page: 5 ----------------------
ISO/IEC 60559:2020(E)
IEEE Std 754-2019
– 6 –
FLOATING-POINT ARITHMETIC
FOREWORD

1) The International Electrotechnical Commission (IEC) is a worldwide organization for standardization comprising

all national electrotechnical committees (IEC National Committees). The object of IEC is to promote

international co-operation on all questions concerning standardization in the electrical and electronic fields. To

this end and in addition to other activities, IEC publishes International Standards, Technical Specifications,

Technical Reports, Publicly Available Specifications (PAS) and Guides (hereafter referred to as “IEC

Publication(s)”). Their preparation is entrusted to technical committees; any IEC National Committee interested

in the subject dealt with may participate in this preparatory work. International, governmental and non-

governmental organizations liaising with the IEC also participate in this preparation.

IEEE Standards documents are developed within IEEE Societies and Standards Coordinating Committees of the

IEEE Standards Association (IEEE-SA) Standards Board. IEEE develops its standards through a consensus

development process, which brings together volunteers representing varied viewpoints and interests to achieve

the final product. Volunteers are not necessarily members of IEEE and serve without compensation. While IEEE

administers the process and establishes rules to promote fairness in the consensus development process, IEEE

does not independently evaluate, test, or verify the accuracy of any of the information contained in its

standards. Use of IEEE Standards documents is wholly voluntary. IEEE documents are made available for use

subject to important notices and legal disclaimers (see http://standards.ieee.org/ipr/disclaimers.html for more

information).

IEC collaborates closely with IEEE in accordance with conditions determined by agreement between the two

organizations.

2) The formal decisions of IEC on technical matters express, as nearly as possible, an international consensus of

opinion on the relevant subjects since each technical committee has representation from all interested IEC

National Committees. The formal decisions of IEEE on technical matters, once consensus within IEEE Societies

and Standards Coordinating Committees has been reached, is determined by a balanced ballot of materially

interested parties who indicate interest in reviewing the proposed standard. Final approval of the IEEE

standards document is given by the IEEE Standards Association (IEEE-SA) Standards Board.

3) IEC/IEEE Publications have the form of recommendations for international use and are accepted by IEC

National Committees/IEEE Societies in that sense. While all reasonable efforts are made to ensure that the

technical content of IEC/IEEE Publications is accurate, IEC or IEEE cannot be held responsible for the way in

which they are used or for any misinterpretation by any end user.

4) In order to promote international uniformity, IEC National Committees undertake to apply IEC Publications

(including IEC/IEEE Publications) transparently to the maximum extent possible in their national and regional

publications. Any divergence between any IEC/IEEE Publication and the corresponding national or regional

publication shall be clearly indicated in the latter.

5) IEC and IEEE do not provide any attestation of conformity. Independent certification bodies provide conformity

assessment services and, in some areas, access to IEC marks of conformity. IEC and IEEE are not responsible

for any services carried out by independent certification bodies.

6) All users should ensure that they have the latest edition of this publication.

7) No liability shall attach to IEC or IEEE or their directors, employees, servants or agents including individual

experts and members of technical committees and IEC National Committees, or volunteers of IEEE Societies

and the Standards Coordinating Committees of the IEEE Standards Association (IEEE-SA) Standards Board,

for any personal injury, property damage or other damage of any nature whatsoever, whether direct or indirect,

or for costs (including legal fees) and expenses arising out of the publication, use of, or reliance upon, this

IEC/IEEE Publication or any other IEC or IEEE Publications.

8) Attention is drawn to the normative references cited in this publication. Use of the referenced publications is

indispensable for the correct application of this publication.

9) Attention is drawn to the possibility that implementation of this IEC/IEEE Publication may require use of

material covered by patent rights. By publication of this standard, no position is taken with respect to the

existence or validity of any patent rights in connection therewith. IEC or IEEE shall not be held responsible for

identifying Essential Patent Claims for which a license may be required, for conducting inquiries into the legal

validity or scope of Patent Claims or determining whether any licensing terms or conditions provided in

connection with submission of a Letter of Assurance, if any, or in any licensing agreements are reasonable or

non-discriminatory. Users of this standard are expressly advised that determination of the validity of any patent

rights, and the risk of infringement of such rights, is entirely their own responsibility.

---------------------- Page: 6 ----------------------
ISO/IEC 60559:2020(E)
IEEE Std 754-2019 – 7 –

International Standard ISO/IEC 60559/IEEE Std 754 has been processed through ISO/IEC

subcommittee 25: Interconnection of information technology equipment, of ISO/IEC joint

technical committee 1: Information technology, under the IEC/IEEE Dual Logo Agreement.

The text of this standard is based on the following documents:
IEEE Std FDIS Report on voting
754 (2019) JTC1-SC25/2933/FDIS JTC1-SC25/2936/RVD

Full information on the voting for the approval of this standard can be found in the report on

voting indicated in the above table.

The IEC Technical Committee and IEEE Technical Committee have decided that the contents

of this publication will remain unchanged until the stability date indicated on the IEC web site

under "http://webstore.iec.ch" in the data related to the specific publication. At this date, the

publication will be
• reconfirmed,
• withdrawn,
• replaced by a revised edition, or
• amended.
---------------------- Page: 7 ----------------------
ISO/IEC 60559:2020(E)
IEEE Std 754-2019
– 8 –
P754 2.63
IEEE Std 754™-2019
(Revision of IEEE Std 754-2008)
IEEE Standard for Floating-Point
Arithmetic
Sponsor
Microprocessor Standards Committee
of the
IEEE Computer Society
Approved 13 June 2019
IEEE-SA Standards Board
---------------------- Page: 8 ----------------------
ISO/IEC 60559:2020(E)
IEEE Std 754-2019 – 9 –
IEEE Std 754-2019
IEEE Standard for Floating-Point Arithmetic

Abstract: This standard specifies interchange and arithmetic formats and methods for binary and

decimal floating-point arithmetic in computer programming environments. This standard specifies

exception conditions and their default handling. An implementation of a floating-point system

conforming to this standard may be realized entirely in software, entirely in hardware, or in any

combination of software and hardware. For operations specified in the normative part of this

standard, numerical results and exceptions are uniquely determined by the values of the input

data, sequence of operations, and destination formats, all under user control.

Keywords: arithmetic, binary, computer, decimal, exponent, floating-point, format, IEEE 754™,

interchange, NaN, number, rounding, significand, subnormal.
Copyright © 2019 IEEE. All rights reserved.
---------------------- Page: 9 ----------------------
ISO/IEC 60559:2020(E)
IEEE Std 754-2019
– 10 –
IEEE Std 754-2019
IEEE Standard for Floating-Point Arithmetic
IEEE Introduction

This introduction is not part of IEEE Std 754-2019, IEEE Standard for Floating-Point Arithmetic.

This standard is a product of the Floating-Point Working Group of, and sponsored by, the Microprocessor

Standards Committee of the IEEE Computer Society.

This standard provides a discipline for performing floating-point computation that yields results

independent of whether the processing is done in hardware, software, or a combination of the two. For

operations specified in the normative part of this standard, numerical results and exceptions are uniquely

determined by the values of the input data, the operation, and the destination, all under user control.

This standard defines a family of commercially feasible ways for systems to perform binary and decimal

floating-point arithmetic. Among the desiderata that guided the formulation of this standard were:

a) Facilitate movement of existing programs from diverse computers to those that adhere to this

standard as well as among those that adhere to this standard.

b) Enhance the capabilities and safety available to users and programmers who, although not

expert in numerical methods, might well be attempting to produce numerically sophisticated

programs.

c) Encourage experts to develop and distribute robust and efficient numerical programs that are

portable, by way of minor editing and recompilation, onto any computer that conforms to this

standard and possesses adequate capacity. Together with language controls it should be possible to

write programs that produce identical results on all conforming systems.
d) Provide direct support for
― execution-time diagnosis of anomalies
― smoother handling of exceptions
― interval arithmetic at a reasonable cost.
e) Provide for development of
― common elementary functions such as exp or cos
― high precision (multiword) arithmetic
― coupled numerical and symbolic algebraic computation.
f) Enable rather than preclude further refinements and extensions.

In programming environments, this standard is also intended to form the basis for a dialog between the

numerical community and programming language designers. It is hoped that language-defined methods for

the control of expression evaluation and exceptions might be defined in coming years, so that it will be

possible to write programs that produce identical results on all conforming systems. However, it is

recognized that utility and safety in languages are sometimes antagonists, as are efficiency and portability.

Therefore, it is hoped that language designers will look on the full set of operation, precision, and

exception controls described here as a guide to providing the programmer with the ability to portably

control expressions and exceptions. It is also hoped that designers will be guided by this standard to

provide extensions in a completely portable way.

Informative annexes provide additional information – Annex A lists bibliographical resources, Annex B

suggests programming environment features for debugging support, and Annex C lists all references to the

operations of the standard.
Copyright © 2019 IEEE. All rights reserved.
---------------------- Page: 10 ----------------------
ISO/IEC 60559:2020(E)
IEEE Std 754-2019 – 11 –
Floating-Point Arithmetic
1.0
1. Overview
1.1.0
1.1 Scope

This standard specifies formats and operations for floating-point arithmetic in computer systems. Exception

conditions are defined and handling of these conditions is specified.
1.2.0
1.2 Purpose

This standard provides a method for computation with floating-point numbers that will yield the same

result whether the processing is done in hardware, software, or a combination of the two. The results of the

computation will be identical, independent of implementation, given the same input data. Errors, and error

conditions, in the mathematical processing will be reported in a consistent manner regardless of

implementation.
1.3.0
1.3 Inclusions
This standard specifies:

― Formats for binary and decimal floating-point data, for computation and data interchange.

― Addition, subtraction, multiplication, division, fused multiply add, square root, compare, and

other operations.
― Conversions between integer and floating-point formats.
― Conversions between different floating-point formats.

― Conversions between floating-point formats and external representations as character sequences.

― Floating-point exceptions and their handling, including data that are not numbers (NaNs).

1.4.0
1.4 Exclusions
This standard does not specify:
― Formats of integers.
― Interpretation of the sign and significand fields of NaNs.
Copyright © 2019 IEEE. All rights reserved.
---------------------- Page: 11 ----------------------
ISO/IEC 60559:2020(E)
IEEE Std 754-2019
– 12 –
IEEE Std 754-2019
IEEE Standard for Floating-Point Arithmetic
1.5.0
1.5 Programming environment considerations

This standard specifies floating-point arithmetic in two radices, 2 and 10. A programming environment

may conform to this standard in one radix or in both.

This standard does not define all aspects of a conforming programming environment. Such behavior should

be defined by a programming language definition supporting this standard, if available, and otherwise by a

particular implementation. Some programming language specifications might permit some behaviors to be

defined by the implementation.

Language-defined behavior should be defined by a programming language standard supporting this

standard. Then all implementations conforming both to this floating-point standard and to that language

standard behave identically with respect to such language-defined behaviors. Standards for languages

intended to reproduce results exactly on all platforms are expected to specify behavior more tightly than do

standards for languages intended to maximize performance on every platform.

Because this standard requires facilities that are not currently available in common programming

languages, the standards for such languages might not be able to fully conform to this standard if they are

no longer being revised. If the language can be extended by a function library or class or package to

provide a conforming environment, then that extension should define all the language-defined behaviors

that would normally be defined by a language standard.

Implementation-defined behavior is defined by a specific implementation of a specific programming

environment conforming to this standard. Implementations define behaviors not specified by this standard

nor by any relevant programming language standard or programming language extension.

Conformance to this standard is a property of a specific implementation of a specific programming

environment, rather than of a language specification.

However a language standard could also be said to conform to this standard if it were constructed so that

every conforming implementation of that language also conformed automatically to this standard.

1.6.0
1.6 Word usage

In this standard three words are used to differentiate between different levels of requirements and

optionality, as follows:

― may indicates a course of action permissible within the limits of the standard with no implied

preference (“may” means “is permitted to”)

― shall indicates mandatory requirements strictly to be followed in order to conform to the standard

and from which no deviation is permitted (“shall” means “is required to”)

― should indicates that among several possibilities, one is recommended as particularly suitable,

without mentioning or excluding others; or that a certain course of action is preferred but not

necessarily required; or that (in the negative form) a certain course of action is deprecated but not

prohibited (“should” means “is recommended to”).
Further:

― might indicates the possibility of a situation that could occur, with no implication of the

likelihood of that situation (“might” means “could possibly”)

― see followed by a number is a cross-reference to the clause or subclause of this standard identified

by that number

― NOTE introduces text that is informative (that is, is not a requirement of this standard).

Copyright © 2019 IEEE. All rights reserved.
---------------------- Page: 12 ----------------------
ISO/IEC 60559:2020(E)
IEEE Std 754-2019 – 13 –
IEEE Std 754-2019
IEEE Standard for Floating-Point Arithmetic
2.0
2. Definitions, abbreviations, and acronyms
2.1.0
2.1 Definitions
For the purposes of this standard, the following terms and definitions apply.

applicable attribute: The value of an attribute governing a particular instance of execution of a

computational
...

Questions, Comments and Discussion

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