简体   繁体   中英

Is Int64 supported on all Windows versions?

If I use a variable of type Int64 , will it work on all Windows versions: win95, 98, 2000, nt, xp, vista, win7? No matter what OS it is 32bit or 64bit? And no matter what CPU they are using?

I just want to be sure, that my program will work on all Windows versions.

The size of datatypes provided by a language is not constrained by the operating system or hardware platform. I can have 64-bit integers on 32-bit platforms (or 16- or 8- or 11-bit, for that matter).

Int64 variables are supported by the 32 bit Delphi compiler. All operations on Int64 operands will give identical results no matter what platform (machine, OS etc.) the code executes on.

On 32 bit platforms the compiler has to use special routines to perform 64 bit arithmetic using the 32 bit machine instructions that are available. When targetting a 64 bit machine the compiler can use native 64 bit instructions. No matter, the end result is indistinguishable to you.

Note that if you execute a 32 bit Delphi executable on a 64 bit OS, you will still be using the 32 bit emulator, aka WOW64. From the perspective of the executable, you are running on a 32 bit machine. Unless you are using the new 64 bit compiler introduced in XE2, you will be producing 32 bit executables.

The 64bit integers will work fine on a 32bit operating system. Performance gains in using these data types however will only come when using code compiled for a 64bit operating system - for this you would need Delphi XE2.

Meanwhile you have the benefits extra data capacity, but not extra execution speed (although this would not normally be a consideration for most applications).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM