Re: Bitwise operation

Поиск
Список
Период
Сортировка
От Hubert Lubaczewski
Тема Re: Bitwise operation
Дата
Msg-id 20030630143631.794015db.hubert.lubaczewski@eo.pl
обсуждение исходный текст
Ответ на Bitwise operation  ("Rudi Starcevic" <rudi@oasis.net.au>)
Список pgsql-sql
On Mon, 30 Jun 2003 22:28:15 +1000
"Rudi Starcevic" <rudi@oasis.net.au> wrote:

> SELECT 1111 & 111 = 71
> I was expecting the second example to be 
> SELECT 1111 & 111 = 111

hmm ..:
let's see:
dec(1111) is bin(10001010111)
dec(111)  is bin(00001101111)

so, when we'll "AND" them:
1111 :  10001010111 
111  :  00001101111 
-------------------         00001000111 : dec: 71 

quite reasonable, isn't it?

depesz


В списке pgsql-sql по дате отправления:

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: need some help with a delete statement
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Bitwise operation