| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Squares |
Hello Neil!
Replying to a message of Neil Heller to Bill Birrell:
BB>> That was why j notation had to be invented.
NH> j notation? What's that?
Imaginary numbers - although mathemeticians usually use i rather than j, in
my experience. I used both in university, depending on whether I was in a
course offered from the Math faculty, or the Engineering faculty...
NH> As originally stated, the code you posted went something like:
NH> for (int n=0; n < MAXINT; n++)
NH> printf("d\n", n * n);
(minor typo - forgetting the % ;->)
NH> When n > sqrt(MAXINT) the result of n*n would be negative.
And this is neither math nor engineering - it's computer science. :-)
More accurately, the result of n*n would appear negative. And that's not
entirely true, either. The result of n*n _may_ _appear_ negative after the
high-bits were dropped. But nothing says that they _will_ be negative - it
all depends on whatever high bit is left. In all likelihood, some will
appear negative, some will not. Either way, they're wrong once n >
sqrt(MAXINT), as you pointed out.
Darin
---
* Origin: Tanktalus' Tower BBS (1:250/102)SEEN-BY: 633/267 270 @PATH: 250/102 99 10/345 106/1 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™.