Undo commit bfeb736 for lang/cem/libcc.ansi/headers/float.h

This restores the correct values of DBL_MAX, DBL_MIN_EXP, and related
constants.  This fixes some range checks within libc, causing
atof("-36e90") and atof("1.44e-288") to return the correct values.
This commit is contained in:
George Koehler 2016-11-06 15:01:25 -05:00
parent daeeb5aca3
commit 19ca28e22f

View file

@ -1,43 +1,79 @@
/*
<float.h> -- simple version used by "gimplify"
last edit: 2007-02-12 D A Gwyn
* float.h - implementation limits
*/
/* $Id$ */
/* Does not exactly fit any model, and is minimal for "universality". */
#if !defined(_FLOAT_H)
#define _FLOAT_H
#define FLT_ROUNDS (-1)
#define FLT_EVAL_METHOD (-1)
#if defined(__vax) || defined(__pdp)
#define FLT_DIG 6
#define FLT_EPSILON 5.96046448e-08F
#define FLT_MANT_DIG 8
#define FLT_MAX 1.70141173e+38F
#define FLT_MAX_10_EXP 38
#define FLT_MAX_EXP 127
#define FLT_MIN 2.93873588e-39F
#define FLT_MIN_10_EXP (-38)
#define FLT_MIN_EXP (-127)
#define DBL_DIG 16
#define DBL_EPSILON 1.38777878078144568e-17
#define DBL_MANT_DIG 8
#define DBL_MAX 1.70141183460469229e+38
#define DBL_MAX_10_EXP 38
#define DBL_MAX_EXP 127
#define DBL_MIN 2.93873587705571877e-39
#define DBL_MIN_10_EXP (-38)
#define DBL_MIN_EXP (-127)
#define LDBL_DIG 16
#define LDBL_EPSILON 1.38777878078144568e-17L
#define LDBL_MANT_DIG 8
#define LDBL_MAX 1.70141183460469229e+38L
#define LDBL_MAX_10_EXP 38
#define LDBL_MAX_EXP 127
#define LDBL_MIN 2.93873587705571877e-39L
#define LDBL_MIN_10_EXP (-38)
#define LDBL_MIN_EXP (-127)
#define FLT_ROUNDS 1
#define FLT_RADIX 2
#define DECIMAL_DIG 10
/* assumes that "gimplify" specifies "-Dfloat=double" */
#define FLT_MANT_DIG 10
#define FLT_EPSILON (1E-9F)
#define FLT_DIG 10
#define FLT_MIN_EXP (-31)
#define FLT_MIN (1E-37F)
#else /* IEEE format */
#define FLT_DIG 6
#define FLT_EPSILON 1.19209290e-07F
#define FLT_MANT_DIG 24
#define FLT_MAX 3.40282347e+38F
#define FLT_MAX_10_EXP 38
#define FLT_MAX_EXP 128
#define FLT_MIN 1.17549435e-38F
#define FLT_MIN_10_EXP (-37)
#define FLT_MAX_EXP 37
#define FLT_MAX (1E+37F)
#define FLT_MAX_10_EXP 37
#define FLT_MIN_EXP (-125)
#define DBL_MANT_DIG 10
#define DBL_EPSILON (1E-9)
#define DBL_DIG 10
#define DBL_MIN_EXP (-31)
#define DBL_MIN (1E-37)
#define DBL_MIN_10_EXP (-37)
#define DBL_MAX_EXP 37
#define DBL_MAX (1E+37)
#define DBL_MAX_10_EXP 37
#define DBL_DIG 15
#define DBL_EPSILON 2.2204460492503131e-16
#define DBL_MANT_DIG 53
#define DBL_MAX 1.7976931348623157e+308
#define DBL_MAX_10_EXP 308
#define DBL_MAX_EXP 1024
#define DBL_MIN 2.2250738585072014e-308
#define DBL_MIN_10_EXP (-307)
#define DBL_MIN_EXP (-1021)
#define LDBL_MANT_DIG 10
#define LDBL_EPSILON (1E-9L)
#define LDBL_DIG 10
#define LDBL_MIN_EXP (-31)
#define LDBL_MIN (1E-37L)
#define LDBL_MIN_10_EXP (-37)
#define LDBL_MAX_EXP 37
#define LDBL_MAX (1E+37L)
#define LDBL_MAX_10_EXP 37
#define LDBL_DIG 15
#define LDBL_EPSILON 2.2204460492503131e-16L
#define LDBL_MANT_DIG 53
#define LDBL_MAX 1.7976931348623157e+308L
#define LDBL_MAX_10_EXP 308
#define LDBL_MAX_EXP 1024
#define LDBL_MIN 2.2250738585072014e-308L
#define LDBL_MIN_10_EXP (-307)
#define LDBL_MIN_EXP (-1021)
#define FLT_ROUNDS 1
#define FLT_RADIX 2
#endif /* vax, pdp or ieee */
#endif /* _FLOAT_H */