Re: Bitwise NOT operator?

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

 



'Twas brillig, and Andy McKenzie at 24/08/10 21:42 did gyre and gimble:
> Even if I'd thought about it in terms of the architecture, I
> would have assumed that PHP would treat a two-bit number as a two-bit
> number

You two-bit hustler!

In all seriousness tho', where do you ever provide a two bit number?

$n = 2;

The above is a number, it's not implicitly a two bit number...

I mean, if I do:

$n = 2;
$n += 2;

What do I get then? $n == 0? That's what *should* happen if $n was
indeed two bits. It would overflow and wrap around.

Your number in $n is in fact represented by whatever the variable type
is. In this case it's a 32 bit integer number.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux