This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Need help Accessing a NAN
- From: norm at dad dot dad dot org
- Cc: cygwin at cygwin dot com, "Steven C. Bankes" <steve at virgil dot evolvinglogic dot com>, "Steven C. Bankes" <stevebankes at yahoo dot com>, "Nathaniel Anagnostou" <nateana at pacbell dot net>
- Cc: norm at dad dot dad dot org
- Date: Mon, 14 Jan 2002 16:45:36 -0800
- Subject: Re: Need help Accessing a NAN
- Reply-to: norm at dad dot org
norm@dad.dad.org writes:
>Under Linux I do:
>
>include <math.h>
>...
>reciprocal=NAN;
>
>
>When I try to compile this under cygwin, gcc complains that NAN is undefined.
>
>Under cygwin, "man nan", tells me about a function named nan(), also using math.h.
>When I try to use it, gcc complains about an implicit declaration of nan().
I solved this problem myself. Albeit very inelegantly
inline double nan()
{
# ifdef NAN
return NAN;
#else
double x=0.0;
return 0/x;
#endif
}
Norman Shapiro
798 Barron Avenue
Palo Alto CA 94306-3109
(650) 565-8215
norm@dad.org
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/