crimeanbob
Programmer
I have C code to handle a 23 digit number as a 'bignum' by holding the digits in a char array. I also have functions to perform basic arithmetic on the bignum.
My problem is that once I have this number I must perform a bitshift. I need to shift right 16 bits. This is o.k. as I can just divide it by 2^16 but doing that I lose the shifted bits. I need to know these as the right 16 bits and the remaining bits provide the two numbers I need to extract.
Does anyone know of exisiting code to do this or preferably a more elegant solution? My Maths was never my strong point.
Thanks in Advance.
My problem is that once I have this number I must perform a bitshift. I need to shift right 16 bits. This is o.k. as I can just divide it by 2^16 but doing that I lose the shifted bits. I need to know these as the right 16 bits and the remaining bits provide the two numbers I need to extract.
Does anyone know of exisiting code to do this or preferably a more elegant solution? My Maths was never my strong point.
Thanks in Advance.