Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

BIT operation on Large Numbers.

Ganesh SrivatsavNov 8 2013 — edited Nov 14 2013

Hello All,

After a long time!

I am trying to do powers of two combinations on more that 64 bits.. I have 200 different values.

I know that sum of two powers of unique numbers give you a unique number that can only be formed by those numbers alone.

Say I have 1,2,3. Then power(2,1)+power(2,2)+power(2,3) gives me 14. 14 can only be formedĀ  by powers 1ith 1,2 and 3.

When My key is 14, I could say it is combination of 1,2 and 3.

If my key is 8.. then I could say the combination is only 3. (as only power(2,3) can form 8. no other sum of two powers can form 8)

I think I can use the BITAND function for upto 63.

Where I am struggling is.. If I have a combination power(2,101)+power(2,199)+power(2,200) gives me 2.41040706638849E60

Is there a simple way to find out the combination 101,199,200. And is there a simple way to find at least if 2.41040706638849E60 is composed of power(2,101). I want to know if 101 is part of the combination.

I am really struggling with my math here. Help is really appreciated.

Sorry, But I felt formatting with brackets is not needed here.

Please also suggest any alternate solutions( to keep numbers small does power(2,0.1)+power(2,0.2) will work?)

Thanks,

G.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 12 2013
Added on Nov 8 2013
33 comments
2,469 views