基本信息
源码名称:非标浮点数转换计算
源码大小:0.18M
文件格式:.rar
开发语言:Pascal
更新时间:2021-04-06
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 1 元×
微信扫码支付:1 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
b:=ceil(ln(a)/ln(2));
Memo1.Clear;
Memo1.Lines.Insert(0,'b= ' floattostr(b));
c:=power(2,b);
Memo1.Lines.Insert(1,'c= ' floattostr(c));
d:=a/c;
Memo1.Lines.Insert(2,'d= ' floattostr(d));
e:=d*256;
a_z:=trunc(e);
a_y:=frac(e);
Memo1.Lines.Insert(3,'e= ' floattostr(e));
Memo1.Lines.Insert(4,'取整= ' inttostr(a_z));
Memo1.Lines.Insert(5,'取余= ' floattostr(a_y));
f:=a_y*256;
b_z:=trunc(f);
b_y:=frac(f);
Memo1.Lines.Insert(6,'f= ' floattostr(f));
Memo1.Lines.Insert(7,'取整= ' inttostr(b_z));
Memo1.Lines.Insert(8,'取余= ' floattostr(b_y));
g:=b_y*256;
c_z:=trunc(g);
c_y:=frac(g);
Memo1.Lines.Insert(9,'g= ' floattostr(g));
Memo1.Lines.Insert(10,'取整= ' inttostr(c_z));
Memo1.Lines.Insert(11,'取余= ' floattostr(c_y));
a_str:=IntToHex(b,2) IntToHex(a_z,2) IntToHex(b_z,2) IntToHex(c_z,2);
Edit2.Text:=IntToHex(b,2) IntToHex(a_z,2) IntToHex(b_z,2) IntToHex(c_z,2);
a:=strtofloat(str1);
b:=ceil(ln(a)/ln(2));
Memo1.Clear;
Memo1.Lines.Insert(0,'b= ' floattostr(b));
c:=power(2,b);
Memo1.Lines.Insert(1,'c= ' floattostr(c));
d:=a/c;
Memo1.Lines.Insert(2,'d= ' floattostr(d));
e:=d*256;
a_z:=trunc(e);
a_y:=frac(e);
Memo1.Lines.Insert(3,'e= ' floattostr(e));
Memo1.Lines.Insert(4,'取整= ' inttostr(a_z));
Memo1.Lines.Insert(5,'取余= ' floattostr(a_y));
f:=a_y*256;
b_z:=trunc(f);
b_y:=frac(f);
Memo1.Lines.Insert(6,'f= ' floattostr(f));
Memo1.Lines.Insert(7,'取整= ' inttostr(b_z));
Memo1.Lines.Insert(8,'取余= ' floattostr(b_y));
g:=b_y*256;
c_z:=trunc(g);
c_y:=frac(g);
Memo1.Lines.Insert(9,'g= ' floattostr(g));
Memo1.Lines.Insert(10,'取整= ' inttostr(c_z));
Memo1.Lines.Insert(11,'取余= ' floattostr(c_y));
a_str:=IntToHex(b,2) IntToHex(a_z,2) IntToHex(b_z,2) IntToHex(c_z,2);
Edit2.Text:=IntToHex(b,2) IntToHex(a_z,2) IntToHex(b_z,2) IntToHex(c_z,2);