111,098
社区成员




//两整数转化成浮点数
static float Int2Float(int a, int b)
{
int c = (a << 16) + (b & 0x0000ffff);//0xffff
byte[] bs = BitConverter.GetBytes(c);
float f = BitConverter.ToSingle(bs, 0);
return f;
}
double getd(int a, int b, int c, int d)
{
int c1 = (a << 16) + (b & 0x0000ffff);//0xffff
int c2 = (c << 16) + (d & 0x0000ffff);//0xffff
byte[] bs1 = BitConverter.GetBytes(c1);
byte[] bs2 = BitConverter.GetBytes(c2);
byte[] bs = new byte[bs1.Length + bs2.Length];
bs2.CopyTo(bs, 0);
bs1.CopyTo(bs, bs2.Length);
double f = BitConverter.ToDouble(bs, 0);
return f;
}