[Cfp-interest] Part 1 introduction

Jim Thomas jaswthomas at sbcglobal.net
Sat Feb 11 13:08:56 PST 2012


Here's a first cut at an introduction for our Part 1 draft. I plan to put it in later this afternoon for posting to the WG14 wiki. Comments/corrections welcome.

-Jim

0    Introduction

0.1    Background

0.1.1   The IEC 60559 floating-point standard

The IEC 60559:1989 international standard was equivalent to the IEEE 754-1985 standard for binary floating-point arithmetic. Its stated goals were:

1      Facilitate movement of existing programs from diverse computers to those that adhere to this standard.

2      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.

3      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.

4      Provide direct support for

a.     Execution-time diagnosis of anomalies

b.     Smoother handling of exceptions

c.     Interval arithmetic at a reasonable cost

5      Provide for development of

a.     Standard elementary functions such as exp and cos

b.     Very high precision (multiword) arithmetic

c.     Coupling of numerical and symbolic algebraic computation

6      Enable rather than preclude further refinements and extensions.

To these ends, the standard specified binary floating-point formats, including representations for Not-a-Number (NaN) and signed infinities and zero, and basic arithmetic operations that compose a well-defined, closed arithmetic system. It also specified status flags for detecting exceptional conditions (invalid operation, division by zero, overflow, underflow, and inexact), controls for choosing different rounding methods, conversions between floating-point formats and decimal character sequences, and a few auxiliary operations.

This standard 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:2011 international standard is equivalent to the IEEE 754-2008 standard for floating-point arithmetic, which is a major revision to IEEE 754-1985.

The revised standard specifies more formats, including decimal as well as binary. It adds a 128-bit binary format to its basic formats. It defines extended formats for all of its basic formats. It specifies data interchange formats (which may or may not be arithmetic), including a 16-bit binary format and an unbounded tower of wider formats. To conform to the floating-point standard, an implementation must provide at least one of the basic formats, along with the required operations.

The revised standard specifies more operations. New requirements include -- among others -- arithmetic operations that round their result to a narrower format than the operands (with just one rounding), more conversions with integer types, more inquiries and comparisons, and more operations for managing flags and modes. New recommendations include an extensive set of mathematical functions and seven reduction functions for sums and scaled products.

The revised standard places more emphasis on reproducible results, which is reflected in its standardization of more operations. For the most part, behaviors are completely specified. The standard requires conversions between floating-point formats and decimal character sequences to be correctly rounded for at least three more decimal digits than is required to distinguish all numbers in the widest supported binary format. It recommends that transcendental functions be correctly rounded.

The revised standard requires a way to specify a constant rounding direction for a static portion of code, with details left to programming language standards. This feature potentially allows rounding control without incurring the overhead of runtime access to a global (or thread) rounding mode.

Other features recommended by the revised standard include alternate methods for exception handling, controls for expression evaluation (allowing or disallowing various optimizations), support for fully reproducible results, and support for program debugging.

The revised standard includes guidance for programming language standards, in recognition of the fact that features of the floating-point standard, even if well supported in the hardware, are not available to users unless the programming language provides a commensurate level of support. The implementation’s combination of both hardware and software determines conformance to the floating-point standard.

0.1.2   C support for IEC 60559

IEC 9899:1999 (C99), in conditionally normative Annex F, introduced nearly complete support for the IEC 60559:1989 standard for binary floating-point arithmetic. Also, C99’s informative Annex G offered a specification of complex arithmetic that is compatible with IEC 60559:1989.

IEC 9899:2011 (C11) includes refinements to the C99 floating-point specification, though is still based on IEC 60559;1989. C11 upgrades Annex G from “informative” to “conditionally normative”.

IEC Technical Report 24732:2008 introduced partial C support for the decimal floating-point arithmetic in IEC 60559:2011. TR 24732, for which technical content was completed while IEEE 754-2008 was still in the later stages of development, specifies decimal types based on IEC 60559:2011 decimal formats, though it does not include all of the operations required by IEC 60559:2011.

0.2    Purpose

The purpose of this Technical Specification is to provide a C language binding for IEC 60559:2011, based on the C11 standard, that delivers the goals of IEC 60559 to users and is feasible to implement. It is organized into five Parts.

Part 1, this document, provides suggested changes to C11 that cover all the requirements, plus some basic recommendations, of IEC 60559:2011 for binary floating-point arithmetic. C implementations intending to support IEC 60559:2011 are expected to conform to conditionally normative Annex F as enhanced by the suggested changes in Part 1.

Part 2 enhances TR 24732 to cover all the requirements, plus some basic recommendations, of IEC 60559:2011 for decimal floating-point arithmetic. C implementations intending to provide an extension for decimal floating-point arithmetic supporting IEC 60559-2011 are expected to conform to Part 2.

Part 3 (Interchange and extended types), Part 4 (Supplementary functions), and Part 5 (Supplementary attributes) cover recommended features of IEC 60559-2011. C implementations intending to provide an extension for these features are expected to conform to the corresponding Parts.

 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20120211/c7be7bda/attachment-0001.html 


More information about the Cfp-interest mailing list