Re: fortran equivalent to C



On Sun, 25 Jan 2009 20:59:47 +0000, none wrote:

I think the simplest way is to replace

x ? a : b

with

IF (x .n.e 0) THEN
a
ELSE
b
END IF

and y = x ? a : b with

IF (x .ne. 0) THEN
y = a
ELSE
y = b
END IF

This gets you your guarantee that a is only evaluted if X != 0, and b only
if x = 0.

It is not simple to automate.

Curious what you mean by the last sentence.
--
larry gates

I don't know if it's what you want, but it's what you get. :-)
-- Larry Wall in <10502@xxxxxxxxxxxxxxxxxxxxxxx>
.