Calculation error for floor function floor(1.4/0.025)

11 次查看(过去 30 天)
if x = floor(1.4/0.025) is 55 in Matlab, how does y = 1.4/0.025 is 56?

采纳的回答

Iain
Iain 2013-5-20
1.4/0.025 actually evaluates to 55.9999999999999928946.
The error is in the FIFTEENTH decimal place, which is an extremely small error, however, it is less than 56, and will "floor" to 55.

更多回答(1 个)

Zhang lu
Zhang lu 2013-5-20
Hi
floor(1.4e3/0.025e3)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by