From owner-freebsd-bugs Sun May 19 6:20:19 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id DDA5B37B40E for ; Sun, 19 May 2002 06:20:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4JDK1Z28680; Sun, 19 May 2002 06:20:01 -0700 (PDT) (envelope-from gnats) Received: from HAL9000.wox.org (12-232-222-90.client.attbi.com [12.232.222.90]) by hub.freebsd.org (Postfix) with ESMTP id 5F85937B407 for ; Sun, 19 May 2002 06:19:33 -0700 (PDT) Received: (from das@localhost) by HAL9000.wox.org (8.11.6/8.11.6) id g4JDJXa22132; Sun, 19 May 2002 06:19:33 -0700 (PDT) (envelope-from das) Message-Id: <200205191319.g4JDJXa22132@HAL9000.wox.org> Date: Sun, 19 May 2002 06:19:33 -0700 (PDT) From: David Schultz Reply-To: David Schultz To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: i386/38288: [PATCH] float.h: long doubles use extended precision Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 38288 >Category: i386 >Synopsis: [PATCH] float.h: long doubles use extended precision >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 19 06:20:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: David Schultz >Release: FreeBSD 4.5-RELEASE-p2 i386 >Organization: >Environment: System: >Description: float.h defines incorrect constants for long doubles, which are 80 bits long and have 64 bits of precision on i386. The following patch corrects the constants and defines the additional constants FLT_EVAL_METHOD and DECIMAL_DIG required by C99. This patch is likely to apply to other architectures. In particular, I believe it applies to ia64, but NOT sparc64. But i386 is the only one I'm sure about. >How-To-Repeat: >Fix: Index: float.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/float.h,v retrieving revision 1.8 diff -u -r1.8 float.h --- float.h 1999/08/28 00:44:11 1.8 +++ float.h 2002/05/19 13:04:30 @@ -39,6 +39,8 @@ #define FLT_RADIX 2 /* b */ #define FLT_ROUNDS 1 /* FP addition rounds to nearest */ +#define FLT_EVAL_METHOD 2 /* must agree with float_t in math.h */ +#define DECIMAL_DIG 21 #define FLT_MANT_DIG 24 /* p */ #define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ @@ -60,13 +62,14 @@ #define DBL_MAX 1.7976931348623157E+308 #define DBL_MAX_10_EXP 308 -#define LDBL_MANT_DIG DBL_MANT_DIG -#define LDBL_EPSILON DBL_EPSILON -#define LDBL_DIG DBL_DIG -#define LDBL_MIN_EXP DBL_MIN_EXP -#define LDBL_MIN DBL_MIN -#define LDBL_MIN_10_EXP DBL_MIN_10_EXP -#define LDBL_MAX_EXP DBL_MAX_EXP -#define LDBL_MAX DBL_MAX -#define LDBL_MAX_10_EXP DBL_MAX_10_EXP +#define LDBL_MANT_DIG 64 +#define LDBL_EPSILON 1.08420217248550443400E-19L +#define LDBL_DIG 19 +#define LDBL_MIN_EXP (-16381) +#define LDBL_MIN 3.36210314311209350626E-4932L +#define LDBL_MIN_10_EXP (-4931) +#define LDBL_MAX_EXP 16384 +#define LDBL_MAX 1.18973149535723176502E+4932L +#define LDBL_MAX_10_EXP 4932 + #endif /* _MACHINE_FLOAT_H_ */ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message