Re: Bitwise operation

From: Hubert Lubaczewski <hubert(dot)lubaczewski(at)eo(dot)pl>
To: "Rudi Starcevic" <rudi(at)oasis(dot)net(dot)au>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Bitwise operation
Date: 2003-06-30 12:36:31
Message-ID: 20030630143631.794015db.hubert.lubaczewski@eo.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 30 Jun 2003 22:28:15 +1000
"Rudi Starcevic" <rudi(at)oasis(dot)net(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2003-06-30 12:42:49 Re: Bitwise operation
Previous Message Rudi Starcevic 2003-06-30 12:28:15 Bitwise operation