Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: D'oh, forgot my title! (Bit twiddling and bit manipulation...)

Re: D'oh, forgot my title! (Bit twiddling and bit manipulation...)

From: <jo_holvoet_at_amis.com>
Date: Tue, 06 Jan 2004 06:09:26 -0800
Message-ID: <F001.005DBD86.20040106060926@fatcity.com>


Maybe a lookup table filled once with 256 input/output pairs ?

mvg/regards

Jo

Connor McDonald <hamcdc_at_yahoo.co.uk>
Sent by: ml-errors_at_fatcity.com
01/06/2004 14:29
Please respond to ORACLE-L  

        To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
        cc: 
        Subject:        Re: D'oh, forgot my title!  (Bit twiddling and bit manipulation...)


As a first cut, bit 'i' appears to map to a new value of power(2,i*2-1)*1.5

eg

   8th bit set
= 10000000 binary
= 128 decimal

so you could have something like:

new_num := 0;
x := 1;
for i in 0 .. 7 loop
  if bitand(orig_num,x) = x then

      new_num := new_num + x*x*3;
  end if;
  x := x*2
end loop;

or something like that...

Cheers
Connor

> ATTACHMENT part 2 application/ms-tnef

name=winmail.dat  



Connor McDonald
web: http://www.oracledba.co.uk
web: http://www.oaktable.net
email: connor_mcdonald_at_yahoo.com

"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will sit in a boat and drink beer all day"



Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: =?iso-8859-1?q?Connor=20McDonald?=
  INET: hamcdc_at_yahoo.co.uk

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: jo_holvoet_at_amis.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Jan 06 2004 - 08:09:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US