From owner-freebsd-bugs Sat Nov 25 18:20: 9 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 2704F37B4CF for ; Sat, 25 Nov 2000 18:20:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id SAA04206; Sat, 25 Nov 2000 18:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from taygeta.dbai.tuwien.ac.at (taygeta.dbai.tuwien.ac.at [128.130.111.77]) by hub.freebsd.org (Postfix) with ESMTP id 0BAEE37B4C5 for ; Sat, 25 Nov 2000 18:12:56 -0800 (PST) Received: (from pfeifer@localhost) by taygeta.dbai.tuwien.ac.at (8.11.1/8.11.1) id eAQ2Ctr44509; Sun, 26 Nov 2000 03:12:55 +0100 (CET) (envelope-from pfeifer) Message-Id: <200011260212.eAQ2Ctr44509@taygeta.dbai.tuwien.ac.at> Date: Sun, 26 Nov 2000 03:12:55 +0100 (CET) From: pfeifer@dbai.tuwien.ac.at (Gerald Pfeifer) To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: misc/23103: lacks many ISO C99 features (NAN, isfinite,...) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 23103 >Category: misc >Synopsis: lacks many ISO C99 features (NAN, isfinite,...) >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Nov 25 18:20:00 PST 2000 >Closed-Date: >Last-Modified: >Originator: Gerald Pfeifer >Release: FreeBSD 4.2-RELEASE i386 >Organization: >Environment: FreeBSD 4.2-RELEASE >Description: AKA /usr/include/math.h lacks a couple of features required by ISO C99. ISO compliant programs will thus fail to compile; one (more or less) prominent one is Wine. Features missing include macros FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, fpclassify(), and isfinite(). >How-To-Repeat: >Fix: Implement the following (and probably further macros); the descriptions are copied from a draft of ISO C99. 7.12 Mathematics [#6] The macros FP_INFINITE FP_NAN FP_NORMAL FP_SUBNORMAL FP_ZERO are for number classification. They represent the mutually exclusive kinds of floating-point values. They expand to integer constant expressions with distinct values. 7.12.3.1 The fpclassify macro Synopsis [#1] #include int fpclassify(real-floating x); Description [#2] The fpclassify macro classifies its argument value as NaN, infinite, normal, subnormal, or zero. First, an argument represented in a format wider than its semantic type is converted to its semantic type. Then classification is based on the type of the argument.184) Returns [#3] The fpclassify macro returns the value of the number classification macro appropriate to the value of its argument. [#4] EXAMPLE The fpclassify macro might be implemented in terms of ordinary functions as #define fpclassify(x) \ ((sizeof (x) == sizeof (float)) ? \ __fpclassifyf(x) \ : (sizeof (x) == sizeof (double)) ? \ __fpclassifyd(x) \ : __fpclassifyl(x)) 7.12.3.2 The isfinite macro Synopsis [#1] #include int isfinite(real-floating x); Description [#2] The isfinite macro determines whether its argument has a finite value (zero, subnormal, or normal, and not infinite or NaN). First, an argument represented in a format wider than its semantic type is converted to its semantic type. Then determination is based on the type of the argument. Returns [#3] The isfinite macro returns a nonzero value if and only if its argument has a finite value. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message