Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!samsung!zaphod.mps.ohio-state.edu!mips!sgi!shinobu!odin!dinkum!calvin From: calvin@dinkum.sgi.com (Calvin H. Vu) Newsgroups: comp.lang.fortran Subject: Re: problem with "pe" format Message-ID: <8474@odin.corp.sgi.com> Date: 4 Jun 90 22:10:13 GMT References: <90155.122858GL4@psuvm.psu.edu> Sender: news@odin.corp.sgi.com Lines: 39 In article <90155.122858GL4@psuvm.psu.edu> GL4@psuvm.psu.edu writes: >--------------------------------------------- > x=1.11 > fs=10.0 > write(*,32) x,fs >32 format(1pe13.3,f10.1) > write(*,*) fs > end >--------------------------------------------- >output: > 1.111E+00 100.0 > 10.00000 >--------------------------------------------- > Does anyone know why the value of "fs" is multiplied by a factor of > ten? I've tried this on a Sun-3, a Gould 9005 running UTX/32 2.1A, > and an IBM mainframe, and gotten the same results. The P Editing causes every real number following it (until another P editing if any) to be multiplied by 10**k where k is called the scale factor and is the number in front of the P. A less confusing way to write this is: 32 format(1p,e13.3,f10.1) Without the scale factor specified, i.e. if the format had been: 32 format(e13.3,f10.1) the result would have been: 0.111E+01 10.0 10.00000 If you note the difference between the two results you can figure out the effects of the P edit descriptor. I'm a little lazy to type all the details so maybe you do need to RTFM :-). -------------------------------------------------------------------------- Calvin H. Vu | "We are each of us angels with Silicon Graphics Computer Systems | only one wing. And we can only calvin@sgi.com (415) 962-3679 | fly embracing each other."