Information Technology - Programming languages, their environments, and system software interfaces - Floating-point extensions for C - Part 3: Interchange and extended types
Introduction: Background IEC 60559 floating-‐point standard 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 robust programs, debugging, and moving programs between systems exceedingly difficult. Now the great majority of systems provide data formats and arithmetic operations according to this standard. The IEC 60559:1989 international standard was equivalent to the IEEE 754-‐1985 standard. Its stated goals were the following: Facilitate movement of existing programs from diverse computers to those that adhere to this standard. Enhance the capabilities and safety available to programmers who, though not expert in numerical methods, may well be attempting to produce numerically sophisticated programs. However, we recognize that utility and safety are sometimes antagonists. 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. When restricted to a declared subset of the standard, these programs should produce identical results on all conforming systems. Provide direct support for a. Execution-‐time diagnosis of anomalies b. Smoother handling of exceptions c. Interval arithmetic at a reasonable cost Provide for development of a. Standard elementary functions such as exp and cos b. Very high pr
Scope: This part of ISO/IEC TS 18661 extends programming language C to include types with the arithmetic interchange and extended floating-‐point formats specified in ISO/IEC/IEEE 60559:2011, and to include functions that support the non-‐arithmetic interchange formats in that standard. 2 Conformance An implementation conforms to this part of ISO/IEC TS 18661 if a) it meets the requirements for a conforming implementation of C11 with all the changes to C11 specified in parts 1-‐3 of ISO/IEC TS 18661; b) it conforms to ISO/IEC TS 18661-‐1 or ISO/IEC TS 18661-‐2 (or both); and c) it defines __STDC_IEC_60559_TYPES__ to 201506L. 3 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:2011, Information technology — Programming languages — C ISO/IEC/IEEE 60559:2011, Information technology — Microprocessor Systems — Floating-‐point arithmetic ISO/IEC TS 18661-‐1:2014, Information technology — Programming languages, their environments and system software interfaces — Floating-‐point extensions for C — Part 1: Binary floating-‐point arithmetic ISO/IEC TS 18661-‐2:2015, Information technology — Programming languages, their environments and system software interfaces — Floating-‐point extensions for C — Part 2: Decimal floating-‐point arithmetic 4 Terms and definitions For the purposes of this document, the terms and definitions given in ISO/IEC 9899:2011, ISO/IEC/IEEE 60559:2011, ISO/IEC TS 18661-‐1:2014, ISO/IEC TS 18661-‐2:2015, and the following apply. ISO/IEC TS 18661-‐3:2015(E) © ISO/IEC 2015 – All rights reserved 4.1 C11 standard ISO/IEC 9899:2011, Information technology — Programming languages C, including Technical Corrigendum 1 (ISO/IEC 9899:2011/Cor. 1:2012) 5 C standard conformance 5.1 Freestanding implementations The specification in C11 + TS18661-‐1 + TS18661-‐2 allows freestanding implementations to conform to this part of ISO/IEC TS 18661. 5.2 Predefined macros Change to C11 + TS18661-‐1 + TS1866