This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

i370 float.h values?


I've not located a proper description of the IBM 370 floating-point
format, and based on the one thing I found:

 Float name          Radix  Sign  Exponent  Fraction   Bias
 ----------          -----  ----  --------  --------  -----
 IBM 370:
*  REAL*4             16     1        7        24        64  0.f * 16**(e-64)
*  REAL*8             16     1        7        56        64

I came up with the fundamental constants

#define __FLT_RADIX__ 16
#define __FLT_MANT_DIG__ 6
#define __FLT_MIN_EXP__ (-63)
#define __FLT_MAX_EXP__ 63
#define __DBL_MANT_DIG__ 14
#define __DBL_MIN_EXP__ (-63)
#define __DBL_MAX_EXP__ 63

from which I derive the rest of the values:

#define __DECIMAL_DIG__ 18
#define __FLT_DIG__ 6
#define __FLT_EPSILON__ 0x1p-20F
#define __FLT_MAX_10_EXP__ 75
#define __FLT_MAX__ 0x1.fffffep251F
#define __FLT_MIN_10_EXP__ (-77)
#define __FLT_MIN__ 0x1p-67F
#define __DBL_DIG__ 15
#define __DBL_EPSILON__ 0x1p-52
#define __DBL_MAX_10_EXP__ 75
#define __DBL_MAX__ 0x1.fffffffffffffep251
#define __DBL_MIN_10_EXP__ (-77)
#define __DBL_MIN__ 0x1p-67

Can someone check these values against a proper ibm 370 float.h?
If they're wrong, I'd also appreciate a pointer to the format so
that I can understand how I messed up.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]