[#78949] [Ruby trunk Feature#13095] [PATCH] io.c (rb_f_syscall): remove deprecation notice — kosaki.motohiro@...
Issue #13095 has been updated by Motohiro KOSAKI.
3 messages
2017/01/03
[#78997] [Ruby trunk Bug#13110] Byte-based operations for String — shugo@...
Issue #13110 has been updated by Shugo Maeda.
3 messages
2017/01/06
[#79228] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150] — Eric Wong <normalperson@...>
naruse@ruby-lang.org wrote:
5 messages
2017/01/23
[#79511] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
— Eric Wong <normalperson@...>
2017/02/13
Eric Wong <normalperson@yhbt.net> wrote:
[#79518] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
— Nobuyoshi Nakada <nobu@...>
2017/02/13
On 2017/02/13 10:04, Eric Wong wrote:
[#79298] [Ruby trunk Bug#13085][Assigned] io.c io_fwrite creates garbage — nobu@...
Issue #13085 has been updated by Nobuyoshi Nakada.
3 messages
2017/01/29
[#79337] Re: [ruby-changes:45397] normal:r57469 (trunk): io.c: recycle garbage on write — SASADA Koichi <ko1@...>
Eric:
4 messages
2017/01/31
[#79352] Re: [ruby-changes:45397] normal:r57469 (trunk): io.c: recycle garbage on write
— Eric Wong <normalperson@...>
2017/01/31
SASADA Koichi <ko1@atdot.net> wrote:
[ruby-core:79086] [Ruby trunk Bug#13062][Assigned] 2.4.0-rc1 BigDecimal regression - to_d inconsistent with other numeric classes
From:
muraken@...
Date:
2017-01-16 03:14:21 UTC
List:
ruby-core #79086
Issue #13062 has been updated by Kenta Murata.
Status changed from Open to Assigned
Assignee set to Kenta Murata
We continue this issue at https://github.com/ruby/bigdecimal/issues/51.
----------------------------------------
Bug #13062: 2.4.0-rc1 BigDecimal regression - to_d inconsistent with other numeric classes
https://bugs.ruby-lang.org/issues/13062#change-62491
* Author: John Hawthorn
* Status: Assigned
* Priority: Normal
* Assignee: Kenta Murata
* Target version:
* ruby -v: 2.4.0-rc1
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
To solve #10286, `BigDecimal()` was changed to raise exceptions on invalid input, which is more consistent with the other numeric types.
Unfortunately, `String#to_d` now also raises errors, which is inconsistent with the other `to_*` methods (`to_i`, `to_f`), which return 0 on error.
Under ruby 2.4.0-rc1:
~~~ ruby
> require 'bigdecimal'
> require 'bigdecimal/util'
> "invalid".to_d
ArgumentError: invalid value for BigDecimal(): "invalid"
> "invalid".to_i
=> 0
> "invalid".to_f
=> 0.0
~~~
Under ruby 2.3.3 or 2.4.0preview3:
~~~ ruby
> "invalid".to_d
=> #<BigDecimal:55871ca1f808,'0.0',9(9)>
> "invalid".to_i
=> 0
> "invalid".to_f
=> 0.0
~~~
There's also a further problem that BigDecimal() still doesn't behave the same as Integer() when given a string with the number at the start:
Under ruby 2.4.0-rc1:
~~~ ruby
> BigDecimal("2 turtle doves")
=> 0.2e1
> Integer("2 turtle doves")
ArgumentError: invalid value for Integer(): "2 turtle doves"
> Float("2 turtle doves")
ArgumentError: invalid value for Float(): "2 turtle doves"
~~~
So `BigDecimal` is still inconsistent.
---Files--------------------------------
fix_13062_string_to_d.patch (1.57 KB)
--
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>