标签: ruby
class Float的floor方法返回大浮点值仅为9的下一个整数。
floor
为什么?
irb(main):041:0> (100.67893).floor => 100 irb(main):042:0> (100.99999999999999999).floor => 101 irb(main):043:0> (99.9999999).floor => 99 irb(main):044:0> (99.9999999999999999999).floor => 100