Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!usenet.stanford.edu!news.ucr.edu!nntp-server.caltech.edu!not-for-mail
From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.lang.fortran,comp.soft-sys.matlab
Subject: Re: Fortran formatted read problem (for matlab MEX file)
Date: Fri, 6 Nov 2009 21:15:23 +0000 (UTC)
Organization: California Institute of Technology, Pasadena
Lines: 24
Message-ID: <hd23lb$iid$1@naig.caltech.edu>
References: <7af025a1-6d40-4458-aab0-35bc43418c00@i12g2000prg.googlegroups.com> <hd1sg5$u5k$1@news.eternal-september.org> <d039a82a-256d-411d-a100-2b07c196cb0f@2g2000prl.googlegroups.com> <hd1v00$kib$1@news.eternal-september.org> <dd6e3ab8-fd69-4aba-bfc7-377b2392841d@f1g2000prf.googlegroups.com> <hd21j5$h90$5@naig.caltech.edu> <6fe4953f-7d24-45aa-8bf8-fd86932bf59f@x5g2000prf.googlegroups.com>
NNTP-Posting-Host: thalia.ugcs.caltech.edu
X-Trace: naig.caltech.edu 1257542123 19021 131.215.176.116 (6 Nov 2009 21:15:23 GMT)
X-Complaints-To: abuse@caltech.edu
NNTP-Posting-Date: Fri, 6 Nov 2009 21:15:23 +0000 (UTC)
User-Agent: tin/1.9.3-20080506 ("Dalintober") (UNIX) (Linux/2.6.26-2-686 (i686))
Xref: news.mathworks.com comp.lang.fortran:213347 comp.soft-sys.matlab:583123


In comp.lang.fortran Nathan <ngreco32@gmail.com> wrote:
(snip)
 
> So reading in 9.7160E+02, I can use F rather than E and disregard
> decimals?

> I'm a little confused as to what you are trying to tell me.
> Why are the decimals unimportant? (or rather, not required)?

If you read with F10.4 format and the data field contains 1234567890
then you get the value of 123456.7890, such that four digits are
after the decimal point.  If you actually write a decimal point
then it uses that independent of the d part of the descriptor.

For input with an exponent but without a decimal point, the d
part indicates the number of digits after the implied decimal point.
With E10.4 if the input contains 1234E0 you get the value 0.1234,
so it is probably best to use the form with d of 0.

On input, I believe that D, E, and F all do the same thing.

For output you get different results from D, E, and F.

-- glen