From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 1094ba,3354bcb01bfd8111 X-Google-Thread: 103376,bda36258b2fe9834 X-Google-Attributes: gid1094ba,gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 31 Jan 2005 21:42:20 -0600 From: "James Van Buskirk" Newsgroups: comp.lang.fortran,comp.lang.ada References: <41f94cab$1@news1.ethz.ch> <1107060103.157135.325010@z14g2000cwz.googlegroups.com> <8u2pv0tdd9b1v689rtqc2c2tlm9pn9t1t6@4ax.com> <1107085125.849687.318060@c13g2000cwb.googlegroups.com> <1107096062.786125.100030@f14g2000cwb.googlegroups.com> <10vq094k09igv3c@corp.supernews.com> <1107160100.162171.223490@f14g2000cwb.googlegroups.com> Subject: Re: Shortcut logicals (was: Re: F200x ) Date: Mon, 31 Jan 2005 20:49:13 -0700 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478 Message-ID: NNTP-Posting-Host: 24.8.173.150 X-Trace: sv3-QgVsCjfw610pfRYe8LJ43ixiJo1tHQ/DWsFTllNeqPHQIPB5AXwMUmhu4K1KXQ0UDV8ZlaiOl3nc9IT!gaw7dRkP71oyNjksjdTKw9+1hH/kh2rVQfiL+pPIfilpeh14W7pSlrUa8jc4cUqmp/Xs7fSMtA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.22 Xref: g2news1.google.com comp.lang.fortran:10033 comp.lang.ada:8098 Date: 2005-01-31T20:49:13-07:00 List-Id: "James Giles" wrote in message news:ZaCLd.474$xR1.216@bgtnsc04-news.ops.worldnet.att.net... > x/=0.0 .and. cond2 .andthen. cond3 .and. 5.0/x>10.0 > ?=> > 5.0/x>10.0 .and. x/=0.0 .and. cond2 .andthen. cond3 > cond2 .andthen. cond3 .and. 5.0/x>10.0 .and. x/=0.0 Obviously the first short-circuits the DIVCHK and the last two don't. > One of the reasons it took me a while to respond is that I *did* > read what you wrote (and couldn't find the subtle relevance you > assert) - I've just reread it again. My puzzlement still remains. > It does seem to me that the case where all operands are scalar > ought to be simpler than more exotic possibilities. And a simple > IF (or even a scalar logical assignment statement) ought to be > simpler to discuss that a WHERE construct. Obviously you don't get it. How do you know what array gets passed to sub: module mymod implicit none contains subroutine sub(x) logical, intent(in) :: x(:) write(*,*) size(x) end subroutine sub function f(n) integer, intent(in) :: n logical f(n) integer i f = mod(mod((17+(/(i,i=1,n)/))**2,97),2) == 0 end function f end module mymod program test use mymod implicit none integer n real x write(*,'(a)',advance='no') 'Enter the size of the array:> ' read(*,*) n write(*,'(a)',advance='no') 'Enter a number:> ' read(*,*) x call sub(x/=0 .AND_THEN. n > 0 .AND. f(n)) end program test So pick apart the first typo you find and tell me you still don't get it... [sigh]. -- write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, & 6.0134700243160014d-154/),(/'x'/)); end