AFAIK literals are integer unless denoted otherwise
The type of the operands determines the operation. this is rather
obvious for e.g. "+" but not obvious for shift operations.
AFAIK, the type left of the ":=" does not determine the operation. This
is not obvious for everybody.
I never rely
In our previous episode, Peter said:
> I was going to comment that the 'bitmask example doesn't work, which it
> didn?t, but looks like its been recently fixed by adding the needed
> QWord cast on the '1's.
>
> http://wiki.freepascal.org/Bit_manipulation
>
> Qwords are certainly trickier to use t
I was going to comment that the 'bitmask example doesn't work, which it
didn’t, but looks like its been recently fixed by adding the needed
QWord cast on the '1's.
http://wiki.freepascal.org/Bit_manipulation
Qwords are certainly trickier to use the Dwords.
_
In our previous episode, Xiangrong Fang said:
> var
> res: Integer;
> mask1, mask2: QWord;
> begin
> mask1 := $ shr 24;
> WriteLn(IntToHex(mask1, 16));
> res := 24;
> mask2 := $ shr res;
> WriteLn(IntToHex(mask2, 16));
> end.
>
> Why they are different
On 08/16/2015 09:38 PM, Xiangrong Fang wrote:
The output is:
00FF
00FF
Why they are different? How can I ensure the result is like SHR with constant.
being curious, i tried your program with the same results... then i changed the
var name from "res" to "foo" with the