Number of significand bits in long double?

Chuck Swiger cswiger at mac.com
Thu Aug 4 17:11:58 GMT 2005


Steve Kargl wrote:
> On Thu, Aug 04, 2005 at 12:49:59PM -0400, Chuck Swiger wrote:
[ ... ]
>>/usr/include/float.h ...?
> 
> It's wrong.  Compare this
> 
[ ...a chunk of <float.h> snipped... ]
>
> with this
> 
>>PROPERTIES OF LONG DOUBLE
>>Base = 2
>>Significant base digits = 53 (= at least 15 decimal digits)
[ ...output from enquire.c trimmed... ]
>>Long double expressions are evaluated in double precision

Agreed, it does look like <float.h> is wrong.  A quick look suggests this was 
broken somewhere in 5.x, since <float.h> from 4.11 ends with:

#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
#endif /* _MACHINE_FLOAT_H_ */

-- 
-Chuck



More information about the freebsd-current mailing list