[fitsbits] 64-bit integer comments

Mark Calabretta mcalabre at atnf.CSIRO.AU
Mon May 16 04:24:59 EDT 2005


On Fri 2005/05/13 10:46:54 -0400, William Pence wrote
and copied to: fitsbits at donar.cv.nrao.edu

>Integer keyword values must fit within a 80-character header record, so are 
>limited to 70 digits, or sign + 69 digits.  Integer 'I' columns in ASCII 
>tables can have almost unlimited number of digits.  The FITS Standard 
>doesn't further restrict the maximum allowed number of digits in these 
>cases.  It's not really appropriate I think for the FITS Standard to make 
>recommendations on how software should deal with such large integers.

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.

>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?

Mark Calabretta




More information about the fitsbits mailing list