TIP: Click on subject to list as thread! ANSI
echo: delphi
to: MARTIN MAAT
from: JUD MCCRANIE
date: 1997-07-24 00:52:00
subject: RE: CARDINAL

 MM> So I figured the last 2147483647 had to be wrong and the reason why you 
 MM> thought the cardinal type was no good. In 16-bits environments we used 
 MM> the integer type word, so cardinal in 32-bit had to be the 32-bit 
 MM> equivalent of word, that is, 32-bit unsigned. Just to proove this I 
 MM> reluctantly started up Delphi 3, soon to find that... you are right! 
 MM> (you already knew that, didn't you?) 
Yes, I did.
 MM> The compiler does not allow you to assign, say, 3 bilion to a cardinal. 
 MM> You can however dec, inc or shift out of the defined range and it will 
 MM> return negative values afterwards, it is really a 32 bit signed integer.
Except that you should get a range check error - except that I
don't think inc, dec, and shift check for that.
 MM> I don't see any point either. It seems to be purely conventional. 
 MM> Perhaps some Pascal definition demands a cardinal type. I do not 
 MM> understand why the real "longword" type was left out. It may be for 
 MM> performance reasons. 
I don't believe it could be for performance reasons.  Maybe
there is some ambiguity in a combination of operations as to
what type numbers are promoted to, and not having 32-bit
unsigned avoids that potential ambiguity.
Jud McCranie  jud.mccranie@camcat.com
 * Silver Xpress V4.3 SW20178
--- PCBoard (R) v15.3/M 5
---------------
* Origin: Riverdale, Ga (1:133/9024)

SOURCE: echomail via exec-pc

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