如何在没有FPU的机器上计算浮点数 [英] How floats are computed on a machine without an FPU

查看:448
本文介绍了如何在没有FPU的机器上计算浮点数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C语言有一个数据类型 float 。有些机器有一个浮点处理器,执行所有的浮点运算。我的问题是:有没有一个浮点处理器的机器?这样的机器如何使用浮点数?

解决方案

许多小型控制器没有浮点单元。在这种情况下,有一个浮点软件库。

在20世纪80年代中期,我们认为自己有福了,如果我们的系统有一个8087,FPU为8086和8088.不幸的是,如果8087存在或不存在,我们的软件必须正常工作。这意味着陷阱和模拟8087指示,如果它是失踪。


C language has a data-type float. Some machines have a floating point processor that carries out all the floating point computations. My question is: Could there be some machines without a floating point processor? How do such machines use floating point?

解决方案

Many small controllers do not have floating point units. In that case, there is a floating point software library.

In the mid-1980s, we considered ourselves blessed if our system had an 8087, the FPU for the 8086 and 8088. Unfortunately our software had to work correctly if an 8087 was present or not. That meant trapping and emulating 8087 instructions if it was missing.

这篇关于如何在没有FPU的机器上计算浮点数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆