This is the mail archive of the
cygwin-talk@cygwin.com
mailing list for the cygwin project.
gcc-3.3.3 :fpclassify
- From: Jianguo dot Zhang at inrialpes dot fr
- To: cygwin-talk at cygwin dot com
- Date: Thu, 30 Dec 2004 21:56:25 +0100
- Subject: gcc-3.3.3 :fpclassify
- Envelope-from: zhang@inrialpes.fr
- Envelope-to: cygwin-talk@cygwin.com
- Reply-to: Talk Amongst Yourselves <cygwin-talk at cygwin dot com>
Hi,
I installed the cygwin/x on my windows xp platform.
The gcc/g++ version is 3.3.3
I am trying to compile the following program using g++ 3.3.3
/***************************test.cpp***************/
#include <cstdlib>
#include <iostream>
#include <cmath>
double nan();
int main()
{
using namespace std;
double a = 0.0;
double b = nan();
double c = 1.0;
if (FP_ZERO != std::fpclassify (a)) abort ();
if (FP_NAN != std::fpclassify (b)) abort ();
if (FP_NORMAL != std::fpclassify (c)) abort ();
cout<<"program ends"<<endl;
}
double nan()
{
# ifdef NAN
return NAN;
#else
double x=0.0;
return 0/x;
#endif
}
/*************************** end of test.cpp***************/
When I use the following command to compile this file under cygwin:
$ g++ test.cpp
the following errors occurs:
test.cpp: In function `int main()':
test.cpp:17: error: `fpclassify' undeclared in namespace `std'
test.cpp:18: error: `fpclassify' undeclared in namespace `std'
test.cpp:19: error: `fpclassify' undeclared in namespace `std'
there is no problem to compile the file under linux system using g++ 3.3.1
Could anyone tell me why?
Thanks
zhang