X
X
x672017-01-13 13:58:38
Fortran
x67, 2017-01-13 13:58:38

Why do programs count differently?

The bottom line is this, I took one old project under compaq visual fortran and recompiled it on the new intel fortran compiler. The code isn't perfect, but it runs flawlessly. Unless I had to put Qzero and Qsave (compiler directives, one initializes variables to 0.00, the other ensures that variables are placed in static memory). But just look at this! I was afraid to live after this. Absolutely the same initial data for calculations, but the result is different! let somewhere in the last decimal places, but still! This is just one of the intermediate variables.. It is very interesting to understand why this happens and whether it can be completely avoided?b24959be869441c499fc2876953d6d39.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
Godless, 2017-01-13
@x67

there is a suspicion of rounding errors, MB accumulated, and MB somewhere the compiler has been optimized ...
I don’t know if it’s possible to do this in Fortran, but try to increase the digit capacity of decimal variables.
well, i.e. if was float, make double.
Still the results of the old compilation were obtained on the same PC? did the hardware change?

I
ivkol, 2017-01-13
@ivkol

Смотрите раздел Применение по ссылке https://ru.wikipedia.org/wiki/%D0%94%D0%BB%D0%B8%D...

D
dom1n1k, 2017-01-15
@dom1n1k

Надо проверить, какие типы данных используются.
Подозреваю, что в одном случае single float, а в другом double.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question