Re: [PHP] Bitwise operators and check if an bit is NOT within the flag.

2006-07-07 Thread Richard Lynch
On Tue, July 4, 2006 7:35 am, Mathijs wrote: > //Do if VALIDATE_CHECK1 is set BUT NOT when VALIDATE_CHECK3 is set. > if ($flag2 & self::VALIDATE_CHECK1 && $flag2 & ~self::VALIDATE_CHECK3) Did you check operator precedence for & versus &&? Perhaps you just need parentheses... I'm also not at all

Re: [PHP] Bitwise operators and check if an bit is NOT within theflag.

2006-07-04 Thread Mathijs
Jochem Maas wrote: Mathijs wrote: Jochem Maas wrote: Mathijs wrote: ... Thank you very much. This seems to work :). cool. heres's a couple of funcs that might help you to understand bitwise operations better: >= 1) { $x++; } return $i ? $j <<= $x: 0; } /* doesn't break when expone

Re: [PHP] Bitwise operators and check if an bit is NOT within theflag.

2006-07-04 Thread Mathijs
Jochem Maas wrote: Mathijs wrote: Jochem Maas wrote: Mathijs wrote: ... Thank you very much. This seems to work :). cool. heres's a couple of funcs that might help you to understand bitwise operations better: >= 1) { $x++; } return $i ? $j <<= $x: 0; } /* doesn't break when expone

Re: [PHP] Bitwise operators and check if an bit is NOT within theflag.

2006-07-04 Thread Mathijs
Jochem Maas wrote: Mathijs wrote: Jochem Maas wrote: Mathijs wrote: ... Thank you very much. This seems to work :). cool. heres's a couple of funcs that might help you to understand bitwise operations better: >= 1) { $x++; } return $i ? $j <<= $x: 0; } /* doesn't break when expone

Re: [PHP] Bitwise operators and check if an bit is NOT within theflag.

2006-07-04 Thread Mathijs
Jochem Maas wrote: Mathijs wrote: Jochem Maas wrote: Mathijs wrote: ... Thank you very much. This seems to work :). cool. heres's a couple of funcs that might help you to understand bitwise operations better: >= 1) { $x++; } return $i ? $j <<= $x: 0; } /* doesn't break when expone

Re: [PHP] Bitwise operators and check if an bit is NOT within theflag.

2006-07-04 Thread Jochem Maas
Mathijs wrote: > Jochem Maas wrote: >> Mathijs wrote: ... >>> > > > Thank you very much. > This seems to work :). cool. heres's a couple of funcs that might help you to understand bitwise operations better: >= 1) { $x++; } return $i ? $j <<= $x: 0; } /* doesn't break when exponents are

Re: [PHP] Bitwise operators and check if an bit is NOT within theflag.

2006-07-04 Thread Mathijs
Jochem Maas wrote: Mathijs wrote: Hello there. I am working with some bitwise Operators for validating some variables. Now i need to know if an certain bit is NOT set and an other bit IS set. Example. class Test { const VALIDATE_CHECK1 = 1; const VALIDATE_CHECK2 = 2; const VALIDATE_CHECK3 =

Re: [PHP] Bitwise operators and check if an bit is NOT within the flag.

2006-07-04 Thread Jochem Maas
Mathijs wrote: > Hello there. > > I am working with some bitwise Operators for validating some variables. > Now i need to know if an certain bit is NOT set and an other bit IS set. > > Example. > > > const VALIDATE_CHECK1 = 1; > const VALIDATE_CHECK2 = 2; > const VALIDATE_CHECK3 = 4; > const V

Re: [PHP] Bitwise operators

2005-09-26 Thread cron
The second value is the number of spaces to shift, dint realize that. Thanks for your time Chris. Angelo - Original Message - From: "Chris Boget" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; Sent: Monday, September 26, 2005 2:02 PM Subject: Re: [PHP] Bi

Re: [PHP] Bitwise operators

2005-09-26 Thread Chris Boget
I tested; I don't want to waste peoples time. Rewriting the question: this outputs: c = 32 d = 0 The question is why? First row is the bit's number and the second row is the bit's value: #8 | #7 | #6 | #5 | #4 | #3 | #2 | #1 --- 128 | 64 | 32 | 16 | 8 |

Re: [PHP] Bitwise operators

2005-09-26 Thread cron
Angelo - Original Message - From: "Chris W. Parker" <[EMAIL PROTECTED]> To: Sent: Monday, September 26, 2005 1:28 PM Subject: RE: [PHP] Bitwise operators [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> on Monday, September 26, 2005 9:18 AM said: > So i

Re: [PHP] Bitwise operators

2005-09-26 Thread Robin Vickery
On 9/26/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > From php manual: > > $a << $b Shift leftShift the bits of $a $b steps to the left (each step > means "multiply by two") > $a >> $b Shift rightShift the bits of $a $b steps to the right (each step > means "divide by two") > > > So i ask what

RE: [PHP] Bitwise operators

2005-09-26 Thread Chris W. Parker
[EMAIL PROTECTED] on Monday, September 26, 2005 9:18 AM said: > So i ask what this output? > > $a = 4; > $b = 3; > > echo $a << $b; > echo $a >> $b; You just spent 3-5 minutes writing an email and now almost 10 minutes waiting for a reply to something that would