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

Wes McKinney wesmckinn at gmail.com
Wed Oct 29 18:56:07 EDT 2008


You would be right about the NAN not being a built-in symbol...any
suggestions for making a NAN? I don't know if there's a a generic way that
will make it back to Python correctly.

On Wed, Oct 29, 2008 at 6:37 PM, Robert Kern <robert.kern at gmail.com> wrote:

> On Wed, Oct 29, 2008 at 17:23, Wes McKinney <wesmckinn at 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
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20081029/0dc91654/attachment.html>


More information about the SciPy-User mailing list