Excel中的舍入功能(工作表一) [英] Round function (worksheet one) in Excel

查看:65
本文介绍了Excel中的舍入功能(工作表一)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Excel 2013,将其键入两个单元格会产生不同的结果.

Using Excel 2013, typing this into two cells yields different results.

=ROUND((10.45-10.00)/1,1) = 0.4

但是

=ROUND(0.45/1,1) = 0.5

我不知道为什么会这样.有人有解释吗?

And I have no idea why this is the case. Anyone have an explanation?

推荐答案

因为Excel使用浮点数学,所以不能保证结果是准确的.在我的Excel 2013安装中,如果我在一个单元格中输入=10.45-10.00,然后将该单元格更改为精度为小数点后30位的数字,则实际答案为0.449999999999999000000000000000.由于0.44999...0.45位于舍入边界的相对侧,因此它们将舍入到小数点后一位不同.

Because Excel uses floating-point math, so results are not guaranteed to be exact. On my Excel 2013 installation, if I enter =10.45-10.00 in a cell, then change that cell to Number with 30 decimal places of precision, the actual answer is 0.449999999999999000000000000000. Since 0.44999... and 0.45 are on opposite sides of the rounding boundary, they round to one decimal place differently.

编辑,另请参见此答案以及问题和其他答案,其中涉及很多内容有关Excel数学不精确的原因的详细信息.

Edit See also this answer and the question and other answers, which go into much more detail about why Excel's math is inexact.

这篇关于Excel中的舍入功能(工作表一)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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