--- Knightking <[EMAIL PROTECTED]> wrote:
> On Thu, 10 Jun 2004 20:08:08 -0700, Justin Patrin  
> <[EMAIL PROTECTED]> wrote:
> 
> > Mark wrote:
> >
> >> [snip]
> >
> > I'm not sure what's wrong with the code you have, but for the
> 4-digit  
> > one you have:
> >
> > $packed = 4-bit var with ABCD encoded in it
> >
> > $a = $packed & 1;
> > $b = $packed & 2;
> > $c = $packed & 4;
> > $d = $packed & 8;
> >
> Just as a side tip, I highly recommend using hexadecimal for
> bitwise  
> functions where possible, i.e.:
> $a = $packed & 0x1;
> $b = $packed & 0x2;
> $c = $packed & 0x4;
> $d = $packed & 0x8;
> $e = $packed & 0x10;
> $f = $packed & 0x20;
> $g = $packed & 0x40;
> $h = $packed & 0x80;
> $i = $packed & 0x100;

Thanks guys. I never really used bitwise operators, but I knew they'd
come in handy one day. Thanks for the tips. Now I just need to get
this monster working.

Mark
> 
> Using M2, Opera's revolutionary e-mail client:
> http://www.opera.com/m2/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=====
Mark Weinstock
[EMAIL PROTECTED]
***************************************
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***************************************


        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

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

Reply via email to