Actions
Bug #13599
closedFloat#ceil(n) doesn't work for small floats
Bug #13599:
Float#ceil(n) doesn't work for small floats
Description
When using ceil to round up to n digits (as opposed to nearest integer) with the optional first argument, it doesn't work for very small floats:
2.4.1 :001 > 0.0000000001.ceil(1)
=> 0.0 # => Expected output: 0.1
# Doing it by hand:
2.4.1 :002 > (0.0000000001 * 10).ceil / 10.0
=> 0.1
Actions