The least significant two bits are a bit-mask (in little endian order, so the least two significant bits in the first byte that is read):
if 0x02 is set the RK value represents a 30 bit signed integer, otherwise it represents a 64 bit floating point double precision number requiring special reconstruction.
if 0x01 is set the corresponding value needs to be divided by 100, so even an integer actually becomes a floating point double precision.
When interpreting RK values as a signed integer, right shifting two bits is required:
int value = rk_value >> 2;
When interpreting RK values as a 64 bit floating point, two steps are required:
the RK value requires appropriate masking:int value = rk_value & 0xfffffffc;
then the 32 bit value will be copied into a 64 bit buffer, and the least significant four bytes need to be initialized as zeroes: 0x00000000.
As a final step, if 0x01 was set into the bit-mask, now we have to divide by 100 before returning the effective cell value. So for 32 bit integers:
Answers & Comments
Answer:
RK values
An RK value is a 32 bit value.
The least significant two bits are a bit-mask (in little endian order, so the least two significant bits in the first byte that is read):
if 0x02 is set the RK value represents a 30 bit signed integer, otherwise it represents a 64 bit floating point double precision number requiring special reconstruction.
if 0x01 is set the corresponding value needs to be divided by 100, so even an integer actually becomes a floating point double precision.
When interpreting RK values as a signed integer, right shifting two bits is required:
int value = rk_value >> 2;
When interpreting RK values as a 64 bit floating point, two steps are required:
the RK value requires appropriate masking:int value = rk_value & 0xfffffffc;
then the 32 bit value will be copied into a 64 bit buffer, and the least significant four bytes need to be initialized as zeroes: 0x00000000.
As a final step, if 0x01 was set into the bit-mask, now we have to divide by 100 before returning the effective cell value. So for 32 bit integers:
double final_value = (double)value / 100.0;
and for 64 bit floats:
Step-by-step explanation:
Brainliest Pls