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

Math evaluation puzzler

$
0
0

In the following snippet, Term1 is part of a larger equation:

real(4) :: Term1, T, Twb, Tref
T = Twb
Tref = 273.15

Term1 = ((2501.6 - 2.3263*(Twb-Tref)) / 2501.6 + 1.8577*(T-Tref) - 4.184*(Twb-Tref))

 

With the temps equal to each other, this term should go to 1.  In fact, by inspecting the form of the equation, it's obvious that it should go to 1.

However, in IVF - when I pause in debug - Term1 is evaluated as -63.62723

Here's the puzzler part:

When I sweep out the numerator w/ my cursor, it's evaluated as 2436.999

When I sweep out the denominator w/ my cursor, it's evaluated as 2436.999

Thus, Term1 should be evaluated very close to 1.0

But it's not!

What the deuce?

 


Viewing all articles
Browse latest Browse all 5691

Latest Images

Trending Articles



Latest Images

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