M
Marc Heiler
round does not want arguments. Is there a reason why not?
Ok, we can easily have workarounds by extending class Float. Or using
another strategy.
http://www.hans-eric.com/code-samples/ruby-floating-point-round-off/
But it made me actually wonder - is there a reason why .round does not
want any arguments?
My brain would easily tell me that I would expect
2.29801801942891420890142890124.round(3)
to become 2.298
Is this not possible because it would become a different object?
Ok, we can easily have workarounds by extending class Float. Or using
another strategy.
http://www.hans-eric.com/code-samples/ruby-floating-point-round-off/
But it made me actually wonder - is there a reason why .round does not
want any arguments?
My brain would easily tell me that I would expect
2.29801801942891420890142890124.round(3)
to become 2.298
Is this not possible because it would become a different object?