From das@HAL9000.wox.org  Sun May 19 06:19:34 2002
Return-Path: <das@HAL9000.wox.org>
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 <FreeBSD-gnats-submit@freebsd.org>; 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 <dschultz@uclink.Berkeley.EDU>
Reply-To: David Schultz <dschultz@uclink.Berkeley.EDU>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] float.h: long doubles use extended precision
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         38288
>Category:       i386
>Synopsis:       [PATCH] float.h: long doubles use extended precision
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 19 06:20:01 PDT 2002
>Closed-Date:    Wed Nov 27 02:09:47 PST 2002
>Last-Modified:  Wed Nov 27 02:09:47 PST 2002
>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:

From: David Schultz <dschultz@uclink.Berkeley.EDU>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: i386/38288: [PATCH] float.h: long doubles use extended precision
Date: Sat, 26 Oct 2002 14:55:26 -0700

 imp@ just committed a variant of this (with the correct value for
 LDBL_DIG, even!).  Please close.
State-Changed-From-To: open->closed 
State-Changed-By: arved 
State-Changed-When: Wed Nov 27 02:09:25 PST 2002 
State-Changed-Why:  
Orginators request, a different fix was committed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38288 
>Unformatted:
