Quantcast
Channel: Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2583

Fortran compound logical expression

$
0
0

Hi guys,

This is my first time in this community, so please forgive me if my question is sort of stupid.

I've been programming in Fortran but never claimed to be a programmer, so without further adieu here is my question:

I noticed that:

c**************************************************

real*8 :: x, y, b, c
if ((x .lt. b) .and. (y .gt. c))

is not equal to:

c******************************************

real*8 :: x, y, b, c
logical :: l1, l2

l1=(x.lt.b)

l2=(y.gt.c)

if (l1 .and. l2)

 

Any idea why?

I am using gfortran.

Regards,

Abedin


Viewing all articles
Browse latest Browse all 2583

Trending Articles



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