floating point inaccurracies when compiling

Florian Hackenberger f.hackenberger@chello.at
Mon Sep 5 08:56:00 GMT 2005


Hi!

I'm using gcc 3.4.3-20050110 compiled with flags "-O2 -march=i686 -pipe" for C 
and C++. When compiling expressions like the following

Array2D< double > numerical_damper = pow(local_model.sum_e_upd2 / 
(local_model.sum_e_cv2 + 1.0e-10 ), 4);

I noticed, that the values used for 1.0e-10 are not really 1.0e-10. To 
visualise that, I forced gcc to produce an error message:

./rfwr.cpp: In member function `void Rfwr::updateCovTriangular(const 
TNT::Array2D<double>&, const TNT::Array2D<double>&, LocalModel&, const 
TNT::Array2D<double>&)':
./rfwr.cpp:251: error: no match for 'operator+' in 
'local_model->LocalModel::sum_e_cv2 + 
1.0000000000000000364321973154977415791655470656e-10'

Is this behaviour as expected, or is there something wrong with my 
installation?

Thanks in advance!

Regards,
	Florian

-- 
Florian Hackenberger
student @
University of Technology
Graz, Austria
florian@hackenberger.at
www.hackenberger.at

-- 
Florian Hackenberger
student @
University of Technology
Graz, Austria
florian@hackenberger.at
www.hackenberger.at



More information about the Gcc-help mailing list