optimization problem?

optimization problem?

I do some optimization to a fortran program, and I have another java program with the same function. I found that a real*8 (that is double in java) subtraction in fortran and java sometimes can result in different outputs! But not all the times, and the difference is also only the least significant bit. for example, 4084D455E2CFF392 and 4084D455E2CFF391.
But then I wrote another small program with the same operands and do subtraction again, fortran and java get the same output, that is 4084D455E2CFF391 instead of 4084D455E2CFF392.
So, I doubt whether the optimization has some problems?

1 contenuto / 0 nuovi
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione