gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [Gnash-commit] gnash/testsuite/actionscript.all ops.as


From: Udo Giacomozzi
Subject: Re[2]: [Gnash-commit] gnash/testsuite/actionscript.all ops.as
Date: Tue, 7 Aug 2007 09:25:12 +0200

Hello zou,

Tuesday, August 7, 2007, 3:10:51 AM, you wrote:
zl> x = 0xffffffff;
zl> x = x << 16;
zl> trace(x); // should output -1, no mater on a 32bit or 64bit system.
zl> shouldn't it?

Why -1 ? You are shifting 16 bits.


Monday, August 6, 2007, 9:33:53 PM, strk wrote:
s>Still, it seems the properietary player returns -65536
s> when shifting both numbers 16 bits left.

Isn't that as expected?

Apparently the PP is using 32 bits signed integer internally when
shifting.

0xFFFFFFFF == 2^32-1 for unsigned int == -1 for signed int

0xFFFFFFFF << 1  == 0xFFFFFFFE == -2
0xFFFFFFFF << 2  == 0xFFFFFFFC == -4
0xFFFFFFFF << 16 == 0xFFFF0000 == -65536

and so on.

Or am I missing something?

Udo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]