Re: Bitwise NOT operator?

From: Date: Wed, 25 Aug 2010 13:46:01 +0000
Subject: Re: Bitwise NOT operator?
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-307653@lists.php.net to get a copy of this message
'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/]

« previous php.general (#307653) next »