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

> Wouldn't you rather write:

 > for (n = 0; n < sqrt(INT_MAX); n++)

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

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

#include
#include
int main(void)
{   int n;
    const int top=(int)sqrt(INT_MAX);
    for(n = 0; n  * Origin: Escan BBS (2:25/200)
SEEN-BY: 633/267 270
@PATH: 25/200 108 252/110 250/501 140/1 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™.