How can I compute the range of signed and unsigned types

William Gropp gropp at mcs.anl.gov
Wed Apr 18 08:13:40 PDT 2001


At 09:32 AM 4/18/2001 -0500, Jared Hodge wrote:
>Chris,
>         The specification for C and C++ aren't specific about the size of 
> data
>types, but I believe that for other languages they are (Fortran
>perhaps).

Fortran only says that the sizeof(REAL) = sizeof(INTEGER) = sizeof(LOGICAL) 
= 1/2 sizeof(DOUBLE PRECISION).  In Fortran (aka Fortran 90/95) it is 
possible to specify a desired precision, but the default sizes are up to 
the implementation.

Java, on the other hand, does specify the sizes.

Code that needs the sizes should consider using the autoconf macros 
designed for this purpose: AC_CHECK_SIZEOF .

Bill





More information about the Beowulf mailing list