floating point inaccurracies when compiling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
www.hackenberger.at

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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux