Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Incorrect Results - Floating Point Issue?

$
0
0

Hi

I am having an issue with a very simple calculation that ends up having "incorrect" results.

VOLUME, LENGTH, WIDTH and THICK are declared as REAL

VOLUME = (LENGTH / 1000.) * (WIDTH / 1000.) * (THICK / 1000.)

When I use the following values:
length = 130 ; width=95 ; thick=14
The debugger shows 1.7289999E-04. Yet I am expecting 1.729E-04 as a result.

I tried declaring VOLUME as REAL*8, yet this did not help. So I tried to change the FloatingPoint settings (eventhough I really don't understand any of their meanings). So far I did not manage to get the "correct" result.

Does anyone know which FloatingPoint Settings (or other settings which I haven't thought about) I have to use to get the "correct" results?
Or are those "incorrect" result normal with Fortran?

Thanks for your Help

 


Viewing all articles
Browse latest Browse all 5691


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>