declare
  n number := ....;
  tmp number;
begin
  tmp := n - ( bitand ((n / 2) ,3681400539))
           - (bitand ((n / 4) ,1227133513));
           
   tmp := mod ( bitand ((tmp + (tmp / 8)) , 3340530119) , 63 );
  dbms_output.put_line(tmp);
end;

Google for “hakmem” to see how it works

Got some thoughts? Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trending