Re: Strange output format

From: Alberto Fasso' (fasso@SLAC.Stanford.EDU)
Date: Thu Jul 19 2007 - 11:27:13 CEST

  • Next message: Helmut Vincke: "RE: Strange output format"

    Hi Helmut,

    > During an activation calculation I encountered a result in the ASCII
    > output file which was "6.4308-100". I think I am not the first who had
    > such a result and therefore I found it worth being discussed in the
    > discussion list.
    > I assume it should be "6.4308E-100"

    No, it is correct according to the Fortran standard. See it in :

    The Ew.d, Dw.d, and Ew.dEe edit descriptors indicate that the external field
    occupies w positions, the fractional part of which consists of d digits,
    unless a scale factor greater than one is in effect, and the exponent part
    consists of e digits. The e has no effect on input. The form of the output
    field for a scale factor of zero is:

    [+] [0] . x x ...x exp

         * where: + signifies a plus or a minus ( 13.5.9)
         * exp is a decimal exponent, one of the following forms:
    For a descriptor Ew.d: form of the exponent E+z1z2 or +0z1z2 (!!!) (if
                          +z1z2z3 (if 99<|exp|<=999) (note that this is your case)
    For a descriptor Ew.dEe: form of the exponent +z1z2z3 or E+z1z2...ze
    For a descriptor Dw.d: form of the exponent D+z1z2 or E+z1z2 or +z1z2 (if
                          +z1z2z3 (if 99<|exp|<=999) (your case)
    where z is a digit. The sign in the exponent is required. A plus sign must
    be used if the exponent value is zero.

    As you can see, the form "6.4308E-100" that you suggest, cannot be used if
    the descriptor is of the type Dw.d or Ew.d. It could be used with Ew.dE3,
    but this form is very rare in my experience.

    > In post processing programs it could cause troubles. Either it is seen
    > as expression and the result is seen as -93.57, or the program crashes.
    > In the first case it might even go unnoticed resulting in bad results.

    Only if your post processing program is not in Fortran. For a Fortran
    post processing program, there can be no problem.


  • Next message: Helmut Vincke: "RE: Strange output format"

    This archive was generated by hypermail 2.1.6 : Thu Jul 19 2007 - 11:50:15 CEST