[SciPy-user] Enabling NaN-usage in F77 code on Windows

Robert Kern robert.kern@gmail....
Wed Oct 29 17:37:12 CDT 2008

On Wed, Oct 29, 2008 at 17:23, Wes McKinney <wesmckinn@gmail.com> wrote:
> I'm having some trouble getting NaN's to return from f77 code running under
> latest f2py in both g77 and gfortran. I would prefer to use gfortran but
> whenever I set a result value = NAN, it comes back to Python as 0. Has
> anyone tackled this issue? I am new to using f2py, have been moving along
> fine with everything else but ran into this.

Is NAN a builtin symbol in FORTRAN-77? I don't think it is. I think
what's happening is that the compiler sees you using the name and
implicitly creates a variable for it and initializes it to 0. You will
have to make your own NAN.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the SciPy-user mailing list