Issue #13848 has been updated by ddoherty03 (Daniel Doherty).


Robert, yes, I think it should be the same as BigDecimal.new('200.').  The problem arises, not when a programmer is typing the number---requiring a programmer to be explicit is OK by me---but when strings are processed that come from a user of the code.

ss = '200.' # Read from a user-prepared file.
BigDecimal.new(ss) => ArgumentError ...

As it is, the programmer has to massage every string to recognize a reasonable, albeit a bit sloppy, string that is clearly meant as a valid number.

Regards,


----------------------------------------
Bug #13848: BigDecimal.new('200.') raises an exception
https://bugs.ruby-lang.org/issues/13848#change-66343

* Author: ddoherty03 (Daniel Doherty)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
BigDecimal.new('200.') raises an exception:

ArgumentError: invalid value for BigDecimal(): "200."

It should accept this as a valid decimal number.

This requires fixing numbers read in from the wild.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>