> > You were using -mfpmath=387 (possible as the default), and that uses > > Intel native arithmetic, which is NOT standard IEEE 754 double, but > > an extended format. > > > > If you use -mfpmath=sse, you will get what you expect. > > Thank you for your reply. This explains the problem. > > However, solving the problem seems to be harder. > I tried "gcc -mfpmath=sse", but obtained the warning: > SSE instruction set disabled, using 387 arithmetics. I have never discovered a gcc switch to enable 'proper' IEEE 754 arithmetic. -ffloat-store does something, at the expense of slowing down code. There are reasons for this. IEEE 754 is a hardware specification and, in over 20 years, has neve been supported by programming languages. The IEEE 754 fanatics claim that it is the language and compiler people being uncooperative, but it really is due to the fact that the IEEE 754 standard is very unsuitable for implementing in any high-level language I know of. It also has major numerical RAS flaws, but that's another matter. C99 has taken in on board, but is a complete crock, and only Sun (and POSSIBLY some Microsoft-only compilers) support that aspect. You should learn how to write numeric code that is independent of the arithmetic, which will also usually make it more robust. That is what we used to do 30+ years ago, when there was a LOT more variation than there is today. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: nmm1@xxxxxxxxx Tel.: +44 1223 334761 Fax: +44 1223 334679