Can you (or anyone else) explain to me how, or point me somewhere that I can 
learn how this works? I'd really like to know more about how bitwise arithmetic 
works.
 
Thanks

>>> Francesco Riosa <[EMAIL PROTECTED]> 1/10/06 4:58:47 PM >>>
Francesco Riosa wrote:
> And another one is (in inverse order for laziness):
>
> select
> (8 & 1) AS `0`
> , (8 & 2 > 1) AS `1`
> , (8 & 4 > 1) AS `2`
> , (8 & 8 > 1) AS `3`
> , (8 & 16 > 1) AS `4`
> , (8 & 32 > 1) AS `5`
> , (8 & 64 > 1) AS `6`
> , (8 & 128 > 1) AS `7`
> ;
> 
but this one looks better:

select
(8 & 1) AS `0`
, (8 >> 1 & 1) AS `1`
, (8 >> 2 & 1) AS `2`
, (8 >> 3 & 1) AS `3`
, (8 >> 4 & 1) AS `4`
, (8 >> 5 & 1) AS `5`
, (8 >> 6 & 1) AS `6`
, (8 >> 7 & 1) AS `7`
;

http://dev.mysql.com/doc/refman/4.1/en/bit-functions.html 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql 
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] 



Reply via email to