Beispiel #1
0
        private static double DecodeRKFloat(Bytes.Bits bits, bool div100)
        {
            Bytes.Bits floatBits = bits.Get(2, 30);
            floatBits.Prepend(false); //right-shift to full 8 bytes
            floatBits.Prepend(false);
            byte[] floatBytes = new byte[8];
            floatBits.GetBytes().ByteArray.CopyTo(floatBytes, 4);
            byte[] double1Bytes = BitConverter.GetBytes((double)1);
            double val          = BitConverter.ToDouble(floatBytes, 0);

            if (div100)
            {
                val /= 100.0;
            }
            return(val);
        }
Beispiel #2
0
        // Token: 0x06000157 RID: 343 RVA: 0x000077DC File Offset: 0x000067DC
        private static double DecodeRKFloat(Bytes.Bits bits, bool div100)
        {
            Bytes.Bits bits2 = bits.Get(2, 30);
            bits2.Prepend(false);
            bits2.Prepend(false);
            byte[] array = new byte[8];
            bits2.GetBytes().ByteArray.CopyTo(array, 4);
            BitConverter.GetBytes(1.0);
            double num = BitConverter.ToDouble(array, 0);

            if (div100)
            {
                num /= 100.0;
            }
            return(num);
        }
Beispiel #3
0
        private static double DecodeRKFloat(Bytes.Bits bits, bool div100)
        {
            Bytes.Bits floatBits = bits.Get(2, 30);
            floatBits.Prepend(false); //right-shift to full 8 bytes
            floatBits.Prepend(false);
            byte[] floatBytes = new byte[8];
            floatBits.GetBytes().ByteArray.CopyTo(floatBytes, 4);
            byte[] double1Bytes = BitConverter.GetBytes((double)1);
            double val          = BitConverter.ToDouble(floatBytes, 0);

            if (div100)
            {
                val /= 10.0; //do it this way in case we get the same behavior as
                             //above when multiplying by 100
                val /= 10.0;
            }
            return(val);
        }