Actions
Bug #11736
closedFloat(arg) not consistent with documentation
Bug #11736:
Float(arg) not consistent with documentation
Description
Float(arg) → float
Returns arg converted to a float. Numeric types are converted directly, the rest are converted using arg.to_f. Converting nil generates a TypeError.
Strings are NOT converted using arg.to_f
This could be fixed by changing object.c like so:
But it appears that this is desired behavior as there are many specs to ensure this strict validity checking. Please update the documentation to reflect this.
Thanks,
Brian
Files
Actions