pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hubert Lubaczewski <hubert.lubaczewski@eo.pl>
To: Rudi Starcevic <rudi@oasis.net.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Bitwise operation
Date: Mon, 30 Jun 2003 14:36:31 +0200
Message-ID: <20030630143631.794015db.hubert.lubaczewski@eo.pl> (raw)
In-Reply-To: <20030630122815.M76087@oasis.net.au>
References: <20030630122815.M76087@oasis.net.au>

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



view thread (4+ messages)  latest in thread

Message-ID: <20030630143631.794015db.hubert.lubaczewski@eo.pl>
Permalink:  ../20030630143631.794015db.hubert.lubaczewski@eo.pl/
Also on:    postgresql.org/message-id/20030630143631.794015db.hubert.lubaczewski@eo.pl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: hubert.lubaczewski@eo.pl, rudi@oasis.net.au
  Subject: Re: Bitwise operation
  In-Reply-To: <20030630143631.794015db.hubert.lubaczewski@eo.pl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox