Information technology - Programming languages, their environments, and system software interfaces - Floatingpoint extensions for C - Part 1: Binary floating-point arithmetic
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: 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 precision (multiword)
Scope: This part of ISO/IEC TS 18661 extends programming language C to support binary floating-point arithmetic conforming to ISO/IEC/IEEE 60559:2011. It covers all requirements of IEC 60559 as they pertain to C floating types that use IEC 60559 binary formats. This part of ISO/IEC TS 18661 does not cover decimal floating-point arithmetic, nor does it cover most optional features of IEC 60559. This part of ISO/IEC TS 18661 is primarily an update to IEC 9899:2011 (C11), normative Annex F (IEC 60559 floating-point arithmetic). However, it proposes that the new interfaces that are suitable for general implementations be added in the Library clauses of C11. Also it includes a few auxiliary changes in C11 where the specification is problematic for IEC 60559 support. 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 this part of ISO/IEC TS 18661; and b) It defines __STDC_IEC_60559_BFP__ to 201404L.
Contents:
- Introduction
- Scope
- 14.1.2 Convert to integer type