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]

Re: i370 float.h values?


Richard Henderson wrote:

>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

Since characteristic 0 is not reserved in the
IBM ("hexadecimal") floating point format, the
minimum exponent of both formats should be -64,
not -63.

Thus, the smallest normalised number is 
  0x00100000
which corresponds to
  0.1_(16) x 16 ** (-64) == 16 ** (-65) == 2 ** (-260),
and instead of 
>#define __FLT_MIN__ 0x1p-67F
>#define __DBL_MIN__ 0x1p-67
we should have
#define __FLT_MIN__ 0x1p-260F
#define __DBL_MIN__ 0x1p-260

(I don't quite see where the 67 comes from ...)

This corresponds to 
#define __FLT_MIN_10_EXP__ (-78)
#define __DBL_MIN_10_EXP__ (-78)
instead of
>#define __FLT_MIN_10_EXP__ (-77)
>#define __DBL_MIN_10_EXP__ (-77)

The rest looks OK to me.

>Can someone check these values against a proper ibm 370 float.h?

I'll try to find one tomorrow ...  For now, I've just looked
at the format specification.

>If they're wrong, I'd also appreciate a pointer to the format so
>that I can understand how I messed up.

David already sent you a link to the PoP.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


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