Hi, I'm trying to investigate a weird mathematical problem I've come across using G++. I only have G++ on SuSE 9.1, and so I'm unable to test the code on other systems, kernels etc. I would be grateful if someone could compile and run this code and let me have the results: #include <iostream> #include <math.h> int main() { float l = 45.4567; float d = floorf(l); float m = floorf((l - d) * 60.); float s = (((l - d) * 60.) - m) * 60.; std::cout << "l = " << l << std::endl; std::cout << "d = " << d << std::endl; std::cout << "l-d = " << l - d << std::endl; std::cout << "(l-d) * 60.0 = " << (l - d) * 60. << std::endl; std::cout << "m = " << m << std::endl; std::cout << "s = " << s << std::endl; float r = (s / 3600.) + (m / 60.) + d; std::cout << "reconstructed= " << r << std::endl; return 0; } Basically, I getting an odd value printed for l - d (it comes out as 0.456699 and not 0.4567 as expected). Many thanks, Stuart. -- --------------------------------------- Stuart Bailey BSc (hons) CEng CITP MBCS LinuSoft (Proprietor) (01953) 601294 (07778) 383739 http://www.linusoft.co.uk ---------------------------------------- ********************************************************************** This email and any files transmitted with it are confidential. If you are not the intended recipient, please email postmaster@linusoft.co.uk immediately. You should not copy or use this email or attachments for any purpose nor disclose their contents to any other person. NO BINDING CONTRACT WILL RESULT FROM THIS E-MAIL UNTIL SUCH TIME AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF LinuSoft. LinuSoft cannot accept any responsibility for the completeness or accuracy of this message as it has been transmitted over public networks. *************************************************************************