Re: reading in int and real values
- From: "robin" <robin_v@xxxxxxxxxxx>
- Date: Fri, 28 Oct 2005 23:30:40 GMT
adebayo.alabi@xxxxxxx wrote in message <1130507132.371350.164510@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>...
>Hi,
>I would like to read in the following (mixed) numbers:
>
>1
>-7.5353456456
>1
>-6.5435346666
>1
>0.029633
>-0.1
>0.18363636
>...
>
>I have tried to read the numbers using the following formats but got
>ugly outputs:
What kinds of ugly outputs?
How have you declared the variable that is to receive the
inputs? DOUBLE PRECISION? If not, only the first 6 digits or so
will be used, remaining ones will be jibberish.
The format is inadequate for some of the numbers - the
number -7.5353456456 would require F13.4 because the
count (13) must include the minus sign and the decimal point.
And, as other posters have pointed out, better to use
list-directed input e.g.,
READ (8,*) VALUE
[where VALUE is defined as DOUBLE PRECISION.]
>FORMAT(F12.4)
>AND
>FORMAT(E12.6)
>
>Does anyone know hoe to read these numbers accurately?
>Regards.
.
- References:
- reading in int and real values
- From: adebayo . alabi
- reading in int and real values
- Prev by Date: Re: RANDOM
- Next by Date: Re: PI
- Previous by thread: Re: reading in int and real values
- Next by thread: Coupling Fortran Code with Simulink
- Index(es):
Relevant Pages
|