Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!cornell!batcomputer!thompson
From: thompson@batcomputer.tn.cornell.edu (Steve Thompson)
Newsgroups: comp.lang.fortran
Subject: Re: i++, i+=1, i=i+1
Message-ID: <6370@batcomputer.tn.cornell.edu>
Date: 21 Sep 88 15:13:52 GMT
References: <3976@h.cc.purdue.edu> <3659@lanl.gov> <561@hudson.acc.virginia.edu>
Reply-To: thompson@tcgould.tn.cornell.edu (Steve Thompson)
Organization: Cornell Theory Center, Cornell University, Ithaca NY
Lines: 10

In article <561@hudson.acc.virginia.edu> gl8f@bessel.acc.Virginia.EDU (Greg Lindahl) writes:
	VAX/VMS fortran doesn't work this way, even with math library functions
	which are known to have no side-effects. if you write
		a = sin(x)
		b = sin(x)
		c = sin(x)
	it will call sin() 3 times. anyone have any idea why they would do this?

I couldn't believe this when I saw it, so I checked it on my VMS V4.7/
FORTRAN V4.8 system. Sin(x) does get called only ONCE, as you can
easily verify by looking at the machine code listing.