Page 1 of 1

BitXor of two Decimal(38,0) values

Posted: Fri Mar 06, 2015 7:10 am
by zulfi123786
Hi,

I have two Decimal(38,0) values and have to perform a bitxor of numerical values contained in the decimal columns and have the result again in Decimal(38,0)

Currently I am breaking the decimal into 3 columns each of bigint type taking 18 digits of string representation (last gets only 2 digits) and then applying the bitxor for each of the 3 pieces and appending back into Decimal.

Is there any better built in approach ? some what like converting decimals to binary (BCD with sign excluded) and apply bitxor and convert back to decimal ?