diff options
author | imp <imp@FreeBSD.org> | 2002-10-25 07:02:52 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-10-25 07:02:52 +0000 |
commit | 59e43a0396de61b22eadda85d6d3d4586710c0b9 (patch) | |
tree | 6342f5a3d68acad7e4a722f7510376ad54aea604 | |
parent | 61dd08c523db5d331200b2c7e21b0dbc884dd5d8 (diff) | |
download | FreeBSD-src-59e43a0396de61b22eadda85d6d3d4586710c0b9.zip FreeBSD-src-59e43a0396de61b22eadda85d6d3d4586710c0b9.tar.gz |
Use the correct values for LDBL_*. Libc doesn't completely support
long doubles at the moment (printf truncates them to doubles).
However, long doubles to appear to work to the ranges listed in this
commit on both -stable (4.5) and -current. There may be some slight
rounding issues with long doubles, but that's an orthogonal issue to
these constants.
I've had this in my local tree for 3 months, and in my company's local
tree for 15 months with no ill effects.
Obtained from: NetBSD
Not likely to like it: bde
-rw-r--r-- | sys/amd64/include/float.h | 19 | ||||
-rw-r--r-- | sys/i386/include/float.h | 19 |
2 files changed, 20 insertions, 18 deletions
diff --git a/sys/amd64/include/float.h b/sys/amd64/include/float.h index 5cdbc97..9a075ba 100644 --- a/sys/amd64/include/float.h +++ b/sys/amd64/include/float.h @@ -60,13 +60,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.0842021724855044340E-19L +#define LDBL_DIG 18 +#define LDBL_MIN_EXP (-16381) +#define LDBL_MIN 3.3621031431120935063E-4932L +#define LDBL_MIN_10_EXP (-4931) +#define LDBL_MAX_EXP 16384 +#define LDBL_MAX 1.1897314953572317650E+4932L +#define LDBL_MAX_10_EXP 4932 #endif /* _MACHINE_FLOAT_H_ */ diff --git a/sys/i386/include/float.h b/sys/i386/include/float.h index 5cdbc97..9a075ba 100644 --- a/sys/i386/include/float.h +++ b/sys/i386/include/float.h @@ -60,13 +60,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.0842021724855044340E-19L +#define LDBL_DIG 18 +#define LDBL_MIN_EXP (-16381) +#define LDBL_MIN 3.3621031431120935063E-4932L +#define LDBL_MIN_10_EXP (-4931) +#define LDBL_MAX_EXP 16384 +#define LDBL_MAX 1.1897314953572317650E+4932L +#define LDBL_MAX_10_EXP 4932 #endif /* _MACHINE_FLOAT_H_ */ |