示例#1
0
        public static float CastUIntToFloat(uint value)
        {
            var helper = new ConverterHelperFloat();

            helper.U32 = value;
            return(helper.F32);
        }
示例#2
0
        public static uint CastFloatToUInt(float value)
        {
            var helper = new ConverterHelperFloat();

            helper.F32 = value;
            return(helper.U32);
        }
示例#3
0
        public static void GetBytes(byte[] bytes, int startIndex, float value)
        {
            ConverterHelperFloat ch = new ConverterHelperFloat {
                Afloat = value
            };

            WriteLittleEndian(bytes, startIndex, ch.Aint);
        }
示例#4
0
        public static void Write(byte[] bytes, int startIndex, float value)
        {
            ConverterHelperFloat ch = new ConverterHelperFloat {
                Afloat = value
            };

            Write(bytes, startIndex, ch.Aint);
        }
        int FloatToIntBits(LFloat value)
        {
            ConverterHelperFloat ch = new ConverterHelperFloat {
                ALFloat = value
            };

            return(ch.Aint);
        }
示例#6
0
        public static float ToSingle(byte[] buffer, int index)
        {
            int i = (int)ReadLittleEndian(buffer, index, sizeof(float));
            ConverterHelperFloat ch = new ConverterHelperFloat {
                Aint = i
            };

            return(ch.Afloat);
        }
示例#7
0
        public static float ToSingle(byte[] bytes, int startIndex)
        {
            var value = ReadInt32LittleEndian(bytes, startIndex);
            ConverterHelperFloat ch = new ConverterHelperFloat {
                Aint = value
            };

            return(ch.Afloat);
        }
示例#8
0
        public static void GetBytes(byte[] bytes, int startIndex, float value)
        {
            ConverterHelperFloat converterHelperFloat = default(ConverterHelperFloat);

            converterHelperFloat.Afloat = value;
            ConverterHelperFloat ch = converterHelperFloat;

            WriteLittleEndian(bytes, startIndex, ch.Aint);
        }
示例#9
0
 public void Put(float value)
 {
     ConverterHelperFloat ch = new ConverterHelperFloat { i = value };
     Put(ch.o);
 }
示例#10
0
 public static void GetBytes(byte[] bytes, int startIndex, float value)
 {
     ConverterHelperFloat ch = new ConverterHelperFloat { Afloat = value };
     WriteLittleEndian(bytes, startIndex, ch.Aint);
 }