TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Bill Birrell
from: Jasen Betts
date: 2004-04-17 08:06:40
subject: Squares

Hi Bill.

14-Apr-04 23:53:01, Bill Birrell wrote to Jasen Betts


 >> if speed is a issue, don't multiply either :)

 >>      const int top=(int)sqrt(INT_MAX)*2;
 >>      for(n = -1,s=1; n < top; n+=2) printf("%d %d %d
\n",s+=n,n*n, top);

 BB>     Don't understand, Jasen. You yourself are multiplying.

oops! the printf call was meant to be simply    printf("%d\n",s+=n);

I had the multiplying in there when I was checking it

 -=> Bye <=-

---
* Origin: Dogs come when you call, cats have answering machines (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™.