[fitsbits] 64-bit integer comments

William Pence William.D.Pence at nasa.gov
Mon May 16 11:04:06 EDT 2005


Mark Calabretta wrote:
> According to the standard "A free format integer value follows the same
> rules as fixed format integers [i.e. right-justified in cols 11-30]
> except that it may occur anywhere within columns 11-80."  It doesn't
> actually say anything about the number of digits that are or are not
> allowed, but as you say it could well be inferred that up to 70 digits
> are permitted, and there are plausible examples where such might occur,
> e.g. public keys and the like.  Presumably no current software can
> handle such keywords properly.
> 
> However, I was really suggesting that the standard should warn
> unsuspecting implementors of this surprising feature, not tell them how
> to implement it.

There have been many other suggestions for clarifying various sections of 
the FITS Standard since the last update in 1999, so we should probably start 
thinking about convening another technical revision panel to address all of 
these issues at one time.  (Maybe next year, after the current round of WCS 
and 64-bit integer proposals have been dealt with?)

>>more aware of the need to support larger values.  FITS interface software 
>>like CFITSIO already supports reading FITS keywords into 64-bit int 
>>variables, so there is no technical reason to prevent generic software from 
>>always reading integer keywords into 64-bit ints.  As an example, I recently 
> 
> 
> I looked for the corresponding functions in v2.500 but only found the
> 'long int' forms.  Does it rely on long int being 64-bit?

No, CFITSIO only requires that the C compiler support a 64-bit integer data 
type, but it could be called 'longlong', 'long', '__int64', or something 
else, depending on the particular compiler/platform.  When calling the 
general keyword reading routines in CFITSIO, one needs to specify the data 
type of the variable into which the keyword value is to be returned.  The 
constant 'TLONGLONG' should be used to specify the 64-bit integer data type. 
  CFITSIO also defines and uses 'LONGLONG' as a machine independent 64-bit 
integer data type.  It is 'typedefed' to be equivalent to whatever intrinsic 
64-bit integer data type is available on each particular platform.

Bill Pence
-- 
____________________________________________________________________
Dr. William Pence                          William.D.Pence at nasa.gov
NASA/GSFC Code 662         HEASARC         +1-301-286-4599 (voice)
Greenbelt MD 20771                         +1-301-286-1684 (fax)





More information about the fitsbits mailing list