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

查看:21
本文介绍了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天全站免登陆