TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Pascal Schmidt
from: Bill Birrell
date: 2004-04-24 00:42:00
subject: Squares

> However, we don't have infinite precision numbers in
 > the C language. Using signed integers, the square will
 > become a negative number.

    No, Pascal. Squares of integers can not be negative. Why is this so
difficult to understand? Signed representations are just that -
representations. The limitations of numerical representation on digital
computers may make it appear negative, but appearances in this case
deceive. The computation would fail the reality check.


 > Of course, knowing a square
 > is not supposed to ever become negative, one should
 > use an unsigned data type, but even then we don't have
 > enough bits for large numbers.

    Even that won't do it. The result of squaring an number, positive or
negative must always be positive unless the number is a complex multiple of
i or j. The set of integers does not include the set of complex numbers.
Both sets are subsets of real numbers.

Best Wishes,
Bill.

---
* 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™.