Actions
Bug #10286
closedBigDecimal - inconsistency with other numeric classes
Description
Unlike other numerical classes, BigDecimal does not raise ArgumentError when I try to parse invalid value.
require 'bigdecimal'
BigDecimal('invalid value')
# => #<BigDecimal:7fe6f9a6a058,'0.0',9(9)>
Float('invalid value')
# ArgumentError: invalid value for Float(): "invalid value"
Integer('invalid value')
# ArgumentError: invalid value for Integer(): "invalid value"
Complex('invalid value')
# ArgumentError: invalid value for convert(): "invalid value"
Rational('invalid value')
# ArgumentError: invalid value for convert(): "invalid value"
Actions
Like0
Like0Like0Like0