Discussion:
how to assign a NaN
(too old to reply)
xvtstephen
2010-08-17 15:11:05 UTC
Permalink
I am reading data with lots of missing values and need a good way to
be a ble to assign NaN to integer, real and character vars.

the missing value is represented by an empty string '' ! two quotes
without a space

I am using gfortran which has the isnan(x) to check for nan.

I hope there is a way to use a character representation of the NaN so
then

read(ch(1:2),*) myint,myreal

will give me int and real nans from the same string in ch(1:2)

thanks everybody.
xvtstephen
2010-08-17 15:13:15 UTC
Permalink
Sorry, misplaced post, intended for the fortran group.
Post by xvtstephen
I am reading data with lots of missing values and need a good way to
be a ble to assign NaN to integer, real and character vars.
the missing value is represented by an empty string ''  ! two quotes
without a space
I am using gfortran which has the isnan(x) to check for nan.
I hope there is a way to use a character representation of the NaN so
then
read(ch(1:2),*) myint,myreal
will give me int and real nans from the same string in ch(1:2)
thanks everybody.
Michael Kraemer
2010-08-17 15:23:49 UTC
Permalink
Post by xvtstephen
Sorry, misplaced post, intended for the fortran group.
You're welcome.
It's so lonely in this group that even
misplaced posts are appreciated ;-)
As long as they're not pure spam, that is.

Loading...