TIP: Click on subject to list as thread! ANSI
echo: delphi
to: STEVE ROGERS
from: JUD MCCRANIE
date: 1997-07-25 12:40:00
subject: RE: CARDINAL

 SR>   Makes me wonder, should I use 32-bit vars for counters, etc. where I
 SR>   am now using words? Is there any downside to using 16-bit vars in
 SR>   32-bit programs?
I think it is best to use 32-bit integers in a 32-bit
environment (like Delphi 2 and 3).  Reasons:
1. The extra 2 bytes should not be a problem
2. 32-bit integers will help avoid problems with overflow, etc.
3. It handles 32-bit integers as easily as 16-bit integers.
Maybe easier.  16-bit TP handles 16-bit integer arithmetic a
little faster than 8-bit arithmetic.  As far as I can tell on my
Pentium, though, arithmetic on 16- and 32-bit integers are the
same speed.  On a Pentium Pro, however, 32-bit may be faster
than 16-bit.
To sum up, there is no speed penalty for using 32-bit integers
instead of 16-bit integers with a 32-bit compiler.  There are
other advantages, and the only disadvantage is the extra 2 bytes
per integer, which won't be a problem in most programs.
Jud McCranie  jud.mccranie@camcat.com
... The ease of Pascal with the power of Pascal.
 * 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™.