Are 3-digit exponents OK?

Eric Greisen egreisen at valen.cv.nrao.edu
Sun Feb 21 11:02:34 EST 1999


Patrick L. Nolan writes:
 > I'm working on porting cfitsio to a new compiler.  This compiler has
 > an eccentricity that worries me.  When it prints floating-point numbers,
 > as in FITS headers, it always uses three digits in the exponent.
 > For example, it prints "1.3E+001" rather than the familiar "1.3E+01".
 > 
 > I have looked through a recent Users' Guide to FITS, and it doesn't
 > seem to have anything to say on this issue.  Is this going to break
 > anyone's FITS reader?
 > -- 
 > *   Patrick L. Nolan                                          *
 > *   W. W. Hansen Experimental Physics Laboratory (HEPL)       * 
 > *   Stanford University                                       *
 > 

I have reviewed the  new NOST 100-1.2 (11/98) Definition of FITS which
attempts to spell out Fortran formats rather than forcing modern FITS
users to know details of old languages.  The use of 3 digits does not
violate anything in the NOST document.  It does violate the ANSI
Fortran 77 standard which states that Ew.d and Dw.d formats will
produce e.g. E+01 so long as the xponent abs value is < 99 and a form
e.g.+123 (no E) for larger exponents.  There is the little used format
code Ew.dEe whereby you can in principle force the number of exponent
digits so that Ew.dE2 would give the familiar form.

Eric Greisen



More information about the fitsbits mailing list