TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Bill Birrell
from: Neil Heller
date: 2004-04-11 15:31:00
subject: Squares

> Otherwise, you would start getting negative numbers
> after a bit.

BB>    Fair enough, but I would rather not evaluate 
BB>sqrt(INT_MAX) each time through the loop, so for the price 
BB>of one more stacked identifier - const int top:-

BB>#include
BB>#include
BB>int main(void)
BB>{   int n;
BB>    const int top=(int)sqrt(INT_MAX);
BB>    for(n = 0; n     return 0;
BB>}

That bring up an interesting point.  It is such a common thing to 
compare the loop counter to a result involving the loop counter in some 
sort of function

       (ie:  (for n=0; n * Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
SEEN-BY: 633/267 270
@PATH: 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.