Seth Price corrected me (thanks Seth!). I actually only loose one bit
for the sign.
echo (int)pow(2, 31);
> 1073741824
echo (int)pow(2, 32);
> -2147483648
That's certainly a relief.
I don't know if there are other reasons to have unsigned integers. I
certainly don't mind having it. However
Ezra Nugroho wrote:
I probably should say integers that I can modify with bitwise operators
comfortably without changing the signs. The problem is that people may
want to do comparison after doing bitwise operations. If the sign is
changed, the comparison will not be valid, right?
That's why I
Ezra Nugroho wrote:
Uh, positive bits?
A bitfield is a bitfield. Signedness is irrelevant.
-Rasmus
Yes.
I probably should say integers that I can modify with bitwise operators
comfortably without changing the signs. The problem is that people may
want to do comparison after doing bitwi
On Thu, 9 Feb 2006, Ezra Nugroho wrote:
> I have a task that requires bitflag operations. Having only 16 bits to
> deal with is really bad (I only care about positive int). Having 32
> positive bits in PHP 6 is certainly an improvement, but if I can get all
> 64, then live would be much better.
I
> Uh, positive bits?
> A bitfield is a bitfield. Signedness is irrelevant.
>
> -Rasmus
Yes.
I probably should say integers that I can modify with bitwise operators
comfortably without changing the signs. The problem is that people may
want to do comparison after doing bitwise operations. If
Ezra Nugroho wrote:
PHP developers,
Are the requirements for PHP 6 set in stone?
I saw in the minutes from the Paris meeting that a 64bit integer has
been proposed. I am curious if it would make sense to allow integers to
be both signed and unsigned. For me personally, I would love to have
unsi
PHP developers,
Are the requirements for PHP 6 set in stone?
I saw in the minutes from the Paris meeting that a 64bit integer has
been proposed. I am curious if it would make sense to allow integers to
be both signed and unsigned. For me personally, I would love to have
unsigned 64bit integers.