[comp.lang.fortran] Formatting question

bernhold@qtp.ufl.edu (David E. Bernholdt) (08/23/90)

I want to print out a number in a very compact format like dE-dd
(d=digit), that is without the leading "0." in the mantissa.

My reading of the standard for the E format descriptor says that the
processor is required to put out the decimal point and the leading
zero is optional, but most processors don't give the user the option.
Have I missed any loopholes or other possibilities, or am I going to
have to format this one "by hand"?

Thanks in advance.

-- 
David Bernholdt			bernhold@qtp.ufl.edu
Quantum Theory Project		bernhold@ufpine.bitnet
University of Florida
Gainesville, FL  32611		904/392 6365

fwebb@bbn.com (Fred Webb) (08/24/90)

In article <1121@orange.qtp.ufl.edu> bernhold@qtp.ufl.edu (David E. Bernholdt) writes:
>
>I want to print out a number in a very compact format like dE-dd
>(d=digit), that is without the leading "0." in the mantissa.
>

Well, you probably can't get rid of the decimal point, but by
using SS,1P,E6.0 you'll get something like "1.E-36". I assume
none of your numbers will be negative, or else you need another
character position for the - sign (1P,E7.0).

(I just tried exactly this, with the Fortran compiler I maintain,
 and got the expected result.)

					-- Fred