0

I have 2 or more than that decimal values , I' m converting these values to binary and applying binary operator and then I'm getting single binary value in mysql.

And then I have to use this generated binary in C# and convert that binary value back to decimal values.

Sample Calculation
suppose 1,2 are two decimal values 
binary representation is 001 , 010
if I apply AND operation in mysql then I'm getting 000 as result
now I want to again apply some binary operator on 000 and convert it back to 1,2 in C#

How to do this ? or Is it possible ?

Priyanka
  • 2,802
  • 14
  • 55
  • 88
  • 1
    I don't think this would be possible. Think this way: if you apply + to 2 and 3, you get 5. But what can you do to find out the original components of the 5? – user622505 Nov 28 '13 at 07:49
  • No way, `001` and `010` give you only 1 result but from `000` to get the operands, we have many cases, such as `001` and `100`, `001` and `000`, ... – King King Nov 28 '13 at 07:50

1 Answers1

1

There's no way to tell from 000 that it's a result of a binary operation on 1 and 2.

You'd have to store the values somehow.

Aage
  • 5,932
  • 2
  • 32
  • 57