From willemw@komp Thu Sep 4 16:25:16 1997 Received: from komp.ace.nl (komp.ace.nl [193.78.104.90]) by dkuug.dk (8.6.12/8.6.12) with SMTP id QAA09461 for ; Thu, 4 Sep 1997 16:25:16 +0200 Received: by komp.ace.nl with SMTP id AA27802 (1.14/2.17); Thu, 4 Sep 97 16:23:25 +0200 (MET) To: sc22wg11@dkuug.dk Subject: WG11 N440 (4 of 7): LIA-1 binding for C: LIA-1 + IEC 559 annex Date: Thu, 04 Sep 97 16:23:23 N Message-Id: <27800.873383003@komp> From: Willem Wakker * Document Number: WG14 N751/J11 97-114 C9X Revision Proposal ===================== * Title: LIA-1 Binding: LIA-1 + IEC-559 annex Author: Fred J. Tydeman Author Affiliation: Tydeman Consulting Postal Address: 3711 Del Robles Dr., Austin, Texas, USA, 78727 E-mail Address: tydeman@tybor.com Telephone Number: +1 (512) 255-8696 Fax Number: +1 (512) 255-8696 Sponsor: WG14 Date: 1997-08-27 Proposal Category: __ Editorial change/non-normative contribution __ Correction Y_ New feature __ Addition to obsolescent feature list __ Addition to Future Directions __ Other (please specify) ______________________________ Area of Standard Affected: __ Environment __ Language __ Preprocessor Y_ Library Y_ Macro/typedef/tag name Y_ Function __ Header __ Other (please specify) ______________________________ Prior Art: None known. Target Audience: Programmers writing programs that perform a significant amount of numeric processing.___________________ Related Documents (if any): WG14/N753 (LIA-1 Binding: Rationale), WG14/N752 (LIA-1 Binding: Optional parts annex), WG14/N750 (LIA-1 Binding: LIA-1 annex), WG14/N749 (LIA-1 Binding: ), WG14/N748 (LIA-1 Binding: Adding 'pole' from LIA-2), WG14/N747 (IEC 559 Binding: Signaling NaNs), WG14/N528 (C Binding of LIA-1), WG14/N487 (LIA-1), WG14/N486 (LIA Overview), WG14/N463 (Impact of adding LIA-1) Proposal Attached: _Y Yes __ No, but what's your interest? Abstract: This annex documents the binding required for an implementation to support both IEC 559 and LIA-1. Proposal: Note: The '*' characters in the lefthand column are not part of the proposal (they are useful for emacs M-x outline mode) In the following, bold text, italic text, code sample are the conventions used to indicate text different from normal. * -- Add a new annex (call it I) with the following: Annex I (normative) LIA-1 and IEC 559 compatible arithmetic * I.1 Introduction This annex supplements Annex F (IEC 559 binding) and Annex H (LIA-1 binding) to specify LIA-1 compliant IEC 559 real floating-point arithmetic. An implementation supports this specification if and only if it defines the macros __STDC_IEC_559__ and __STDC_LIA_1__. * I.2 Operations The mapping of LIA-1 operations to C operations and the mapping of IEC 559 unique operations to C operations is extended with: The floating point operations are: = x == y. ?<> x != y. > x > y. >= x >= y. < x < y. <= x <= y. ? isunordered(x, y). <> No binding <=> No binding ?> No binding ?>= No binding ?< No binding ?<= No binding ?= No binding NOT(>) No binding NOT(>=) No binding NOT(<) No binding NOT(<=) No binding NOT(?) !isunordered(x, y) NOT(<>) No binding NOT(<=>) No binding NOT(?>) islessequal(x, y). NOT(?>=) isless(x, y). NOT(?<) isgreaterequal(x, y). NOT(?<=) isgreater(x, y). NOT(?=) islessgreater(x, y). where x and y are expressions of the same floating point type. - The fedisabletrap, feenabletrap, and fetesttrap functions in provide the facility to test and alter the IEC 559 floating-point trap modes. - There is no binding to save or restore an existing trap handler. - The macros FE_TRAP_INVALID, FE_TRAP_DIVBYZERO, FE_TRAP_OVERFLOW, FE_TRAP_UNDERFLOW, and FE_TRAP_INEXACT if defined, or not, allow an application to determine if trapping is implemented for the respective floating-point trap. - The macros FE_FLTPREC, FE_DBLPREC, and FE_LDBLPREC if defined, or not, allow an application to determine if dynamic precision control is implemented. - --- Fred J. Tydeman +1 (512) 255-8696 Tydeman Consulting 3711 Del Robles tydeman@tybor.com Programming, testing, numerics Austin, Texas 78727 Voting member of X3J11 (ANSI "C") USA Sample C9X+FPCE tests: ftp://jump.net/pub/tybor/