[#82706] [Ruby trunk Bug#13851] getting "can't modify string; temporarily locked" on non-frozen instances — cardoso_tiago@...
Issue #13851 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/07
[#82853] [Ruby trunk Bug#13916] Race condition when sending a signal to a new fork — russell.davis@...
Issue #13916 has been reported by russelldavis (Russell Davis).
3 messages
2017/09/19
[#82892] [Ruby trunk Bug#13921] buffered read_nonblock doesn't work as expected using SSLSocket — cardoso_tiago@...
Issue #13921 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/20
[ruby-core:82704] [Ruby trunk Bug#13880] `BigDecimal(string)` should raise on invalid values in `string`
From:
ojab@...
Date:
2017-09-07 13:33:30 UTC
List:
ruby-core #82704
Issue #13880 has been reported by ojab (ojab ojab).
----------------------------------------
Bug #13880: `BigDecimal(string)` should raise on invalid values in `string`
https://bugs.ruby-lang.org/issues/13880
* Author: ojab (ojab ojab)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v:
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Right now `BigDecimal()` happily behaviour differs from `Integer()` and `Float()`:
```
2.4.1 :001 > require 'bigdecimal'
=> true
2.4.1 :002 > BigDecimal('1,')
=> 0.1e1
2.4.1 :003 > Integer('1,')
ArgumentError: invalid value for Integer(): "1,"
from (irb):3:in `Integer'
from (irb):3
from /home/ojab/.rvm/rubies/ruby-2.4.1/bin/irb:11:in `<main>'
2.4.1 :004 > Float('1,')
ArgumentError: invalid value for Float(): "1,"
from (irb):4:in `Float'
from (irb):4
from /home/ojab/.rvm/rubies/ruby-2.4.1/bin/irb:11:in `<main>'
```
and right now AFAIU there is no way to convert, for example, String to BigDecimal with validation.
I think that `BigDecimal()` should likewise raise for consistency, 'bigdecimal/util' & `.to_d` can be used for conversion without checks analogous to `.to_f`/`.to_i`/etc.
--
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>