Search Postgresql Archives

Re: Bitmask trickiness

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

 





the universal solution is a AND with one mask (which has a 1 in every position you wish to test for and a zero in each position you wish to ignore) and an XOR with another mask (that has a 1 in each position that you want to test for a 1 and a zero in each position that you wish to test for a 0)), then a test if the result is == zero.

in a language like SQL, this could be simplified to a AND with MASK1 and a COMPARE for equality with MASK2, with the same result.

-jrp
 (old assembler programmer)



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux