This is the mail archive of the cygwin-talk@cygwin.com mailing list for the cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc-3.3.3 :fpclassify


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]