基本信息
源码名称:IEEE754规范下的4字节与浮点数互转c#源码
源码大小:0.06M
文件格式:.rar
开发语言:C#
更新时间:2017-08-16
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
byte[] bytes = new byte[4];
//bytes[0] = 0x00;
//bytes[1] = 0x00;
//bytes[2] = 0x28;
//bytes[3] = 0x41; //即10.5 0X41280000
//bytes[0] = 0x00;
//bytes[1] = 0x00;
//bytes[2] = 0x48;
//bytes[3] = 0x42; //50 0042 0048
//bytes[0] = 0x00;
//bytes[1] = 0x00;
//bytes[2] = 0x8c;
//bytes[3] = 0x42; //70 0042 008c
bytes[0] = Convert.ToByte(textBox1.Text);//0
bytes[1] = Convert.ToByte(textBox2.Text);// 0;
bytes[2] = Convert.ToByte(textBox3.Text);//72;
bytes[3] = Convert.ToByte(textBox4.Text);// 66; //50 0x00004842
float f = BitConverter.ToSingle(bytes, 0);
txtFudian.Text =f.ToString();
byte[] bytes = new byte[4];
//bytes[0] = 0x00;
//bytes[1] = 0x00;
//bytes[2] = 0x28;
//bytes[3] = 0x41; //即10.5 0X41280000
//bytes[0] = 0x00;
//bytes[1] = 0x00;
//bytes[2] = 0x48;
//bytes[3] = 0x42; //50 0042 0048
//bytes[0] = 0x00;
//bytes[1] = 0x00;
//bytes[2] = 0x8c;
//bytes[3] = 0x42; //70 0042 008c
bytes[0] = Convert.ToByte(textBox1.Text);//0
bytes[1] = Convert.ToByte(textBox2.Text);// 0;
bytes[2] = Convert.ToByte(textBox3.Text);//72;
bytes[3] = Convert.ToByte(textBox4.Text);// 66; //50 0x00004842
float f = BitConverter.ToSingle(bytes, 0);
txtFudian.Text =f.ToString();