Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!carp.cis.ohio-state.edu!adkins From: adkins@carp.cis.ohio-state.edu (Brian Adkins) Newsgroups: comp.lang.c Subject: Re: # to the nth power Message-ID: <85764@tut.cis.ohio-state.edu> Date: 8 Nov 90 15:23:28 GMT References: <9750@helios.TAMU.EDU> <1990Nov1.232830.17131@NCoast.ORG> <1990Nov3.220554.19404@zoo.toronto.edu> <226@smds.UUCP> <1990Nov7.020445.12839@lotus.com> Sender: news@tut.cis.ohio-state.edu Reply-To: Brian Adkins Organization: Ohio State University Computer and Information Science Lines: 21 In article <1990Nov7.020445.12839@lotus.com> blambert@lotus.UUCP (Brian Lambert) writes: >>> for (y=x,sqrtx=1;y>0;) {ysave = y;y =/ 16;sqrtx =* 4;} >It's because programs that take up fewer lines of vertical space also >consume less CPU time. >Brian Lambert Mr. Lambert, do you really believe that the following two routines consume different amounts of CPU time? for (y=x,sqrtx=1;y>0;) { ysave = y; y /= 16; sqrtx *= 4; } for (y=x,sqrtx=1;y>0;) {ysave = y;y /= 16;sqrtx *= 4;} Please correct me if I am mistaken, but I believe any compiler will generate the same code for both of these routines. Brian Adkins