| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Squares |
Hi Bill.
11-Apr-04 13:05:00, Bill Birrell wrote to Neil Heller
>> Wouldn't you rather write:
>> for (n = 0; n < sqrt(INT_MAX); n++)
>> Otherwise, you would start getting negative numbers
>> after a bit.
BB> Fair enough, but I would rather not evaluate sqrt(INT_MAX) each time
BB> through the loop, so for the price of one more stacked identifier - const
BB> int
BB> 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 * Origin: Darth Vader sleeps with a Teddywookie. (3:640/1042)SEEN-BY: 633/267 270 @PATH: 640/1042 531 954 774/605 123/500 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™.