ABorka wrote on Mon, 20 Aug 2012:

Win32 .exe compiled on Win64 computer, latest SVN build.

I am trying to multiply 2 Integers (Declared as LongInt but sometimes need to use it as LongWord) and put the result into a QWord (64bit unsigned) result variable on Win32.
However, it seems that the result is always cut to 32bit.

In Pascal, the type of the result of an expression only depends on its arguments, never on what you do with it afterwards. Additionally, integer expressions are evaluated using the "native bit width" if all factors are <= 32 bit, which is 32 bit on 32 bit systems (exception: operations involving both longint and cardinal).

If you want a 64 bit result, typecast one of the factors of the expressions to 64 bit.


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to