isnan issues resolved (hopefully)

I think I figured out and fixed the situation with isnan.

From http://lists.apple.com/archives/xcode-users/2005/Feb/msg00196.html

Basically the story is this:
isnan() is a C99 extension to standard C.
Standard C++ is based on an older standard of C.
Hence isnan() is not part of standard C++ and may or may not work.

But std::isnan() is part of standard C++ defined in <cmath>.

Since we use C++ (which numpy doesn't) we can drop our own isnan support
and use std::isnan(). Which I just did.

The cmath header also defines isfinite and isinf. So, John, go at the
original change you wanted to make this morning, at least once the dust
settle and we're happy this will work on all target platforms (now
tested with gcc on Mac and Linux -- I'm afraid MSVC is beyond me right now).

-Andrew

We're not out of the woods yet. On my OS X 10.3 powerbook

src/transforms.cpp: In member function `Py::Object Bbox::update(const
   Py::Tuple&)':
src/transforms.cpp:476: error: `isnan' undeclared in namespace `std'

John-Hunters-Computer:~/mpl> gcc --version
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1495)

JDH

···

On 7/13/07, Andrew Straw <strawman@...36...> wrote:

I think I figured out and fixed the situation with isnan.

>From http://lists.apple.com/archives/xcode-users/2005/Feb/msg00196.html

>
> Basically the story is this:
> isnan() is a C99 extension to standard C.
> Standard C++ is based on an older standard of C.
> Hence isnan() is not part of standard C++ and may or may not work.

But std::isnan() is part of standard C++ defined in <cmath>.

Since we use C++ (which numpy doesn't) we can drop our own isnan support
and use std::isnan(). Which I just did.

Can you stick this in the top of src/_transforms.cpp and see if you
still get the problem?

#define _GLIBCPP_USE_C99

-Andrew

John Hunter wrote:

···

On 7/13/07, Andrew Straw <strawman@...36...> wrote:

I think I figured out and fixed the situation with isnan.

>From http://lists.apple.com/archives/xcode-users/2005/Feb/msg00196.html

Basically the story is this:
isnan() is a C99 extension to standard C.
Standard C++ is based on an older standard of C.
Hence isnan() is not part of standard C++ and may or may not work.

But std::isnan() is part of standard C++ defined in <cmath>.

Since we use C++ (which numpy doesn't) we can drop our own isnan support
and use std::isnan(). Which I just did.

We're not out of the woods yet. On my OS X 10.3 powerbook

src/transforms.cpp: In member function `Py::Object Bbox::update(const
   Py::Tuple&)':
src/transforms.cpp:476: error: `isnan' undeclared in namespace `std'
src/transforms.cpp:476: error: `isnan' undeclared in namespace `std'

John-Hunters-Computer:~/mpl> gcc --version
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1495)

JDH

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
matplotlib-devel List Signup and Options

OK, I reverted back to the tried and true MPL way... It hasn't been completely unproductive, however: I added tests for infinity (either sign) and finite-ness to MPL_isnan.h. (On top of which I now understand the IEEE 754 representations far better than I care to.)

Now, this should work just like it did in the good old days... I mean it this time. :slight_smile:

John, commence using your infinity-finding powers!

-Andrew