Floating point consistency

Floating point consistency

I have a CVF DLL which can be called either by a FORTRAN program or a DELPHI PASCAL program. The values that these two programs pass to the DLL are absolutely identical in every bit ( I've painstakingly checked them all ) These numbers are passed ( still bit perfect), to a simple multiplication/addition which produces answers different in the last bit.

Why?

I've looked through all of the floating point consistency flags / optimisations etc., but as exactly the same DLL is being used and the inputs are identical, I can't see what else I should try.

My application is chaotic; the rogue last bit causes the final answers to be completely different. The point of the exercise was to show that the two calling programs produce identical answers, so I'm rather stuck. I don't see what it has actually got to do with the calling program.

Anyone got any ideas?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Have you tried playing with GETCONTROLFPQQ and SETCONTROLFPQQ? Different FP precision on entry to your DLL from different environments looks like the likely culprit.

Entirely correct. For the record, DELPHI sets up Extended Precision, while CVF defaults to Double Precision. They also differ over what to do with infinity. When I forced these to be the same, every bit behaved itself.

Thanks.

Leave a Comment

Please sign in to add a comment. Not a member? Join today