(j3.2006) Does C99 have an equivalent to HUGE?

Jim Xia jimxia
Mon Jun 29 15:12:30 EDT 2009


Here is what C99 says


The parameters for the integer data types can be accessed by the 
following:
maxint INT_MAX, LONG_MAX, LLONG_MAX, UINT_MAX, ULONG_MAX,
ULLONG_MAX
minint INT_MIN, LONG_MIN, LLONG_MIN


I don't have a Mac machine to try this, but on UNIX gcc supports options 
like -mint64 that turns int into 64-bite wide.

Cheers,

Jim Xia

XL Fortran Compiler Test
IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
Phone (905) 413-3444  Tie-line 313-3444
email: jimxia at ca.ibm.com
D2/YF7/8200 /MKM

http://www.ibm.com/software/awdtools/fortran/xlfortran



From:
Van Snyder <Van.Snyder at jpl.nasa.gov>
To:
j3 <j3 at j3-fortran.org>
Date:
06/29/2009 02:26 PM
Subject:
(j3.2006) Does C99 have an equivalent to HUGE?



I have a C code in which gcc 4.4.0 on a Mac notices

e_float/efx/e_float_efx.h(57) : warning: integer constant is too large for 
'long' type
e_float/efx/e_float_efx.h(58) : warning: integer constant is too large for 
'long' type

The code in question is:
      static const INT64 ef_max_exp10    = 
static_cast<INT64>(+89999999999999999);
      static const INT64 ef_min_exp10    = 
static_cast<INT64>(-89999999999999999);

In Fortran, I'd probably use HUGE to initialize these constants.

Does C99 have an equivalent?

Van


_______________________________________________
J3 mailing list
J3 at j3-fortran.org
http://j3-fortran.org/mailman/listinfo/j3


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://j3-fortran.org/pipermail/j3/attachments/20090629/6af71456/attachment.html 



More information about the J3 mailing list