[#78633] ruby/spec needs help from CRuby committers — Benoit Daloze <eregontp@...>
Currently, ruby/spec is maintained mostly by individuals and enjoys the
13 messages
2016/12/13
[#78963] Re: ruby/spec needs help from CRuby committers
— Urabe Shyouhei <shyouhei@...>
2017/01/04
I did ask attendees of last developer meeting to join this
[#78642] Re: ruby/spec needs help from CRuby committers
— Eric Wong <normalperson@...>
2016/12/14
Benoit Daloze <eregontp@gmail.com> wrote:
[ruby-core:78580] [Ruby trunk Bug#12952] Incompatibility of a method signature between `Float#round` and `BigDecimal#round`
From:
muraken@...
Date:
2016-12-10 13:03:25 UTC
List:
ruby-core #78580
Issue #12952 has been updated by Kenta Murata.
I've fixed this in bigdecimal version 1.3.0.pre, which has already been imported in trunk.
----------------------------------------
Bug #12952: Incompatibility of a method signature between `Float#round` and `BigDecimal#round`
https://bugs.ruby-lang.org/issues/12952#change-61967
* Author: Kaneko Yuichiro
* Status: Assigned
* Priority: Normal
* Assignee: Kenta Murata
* ruby -v: ruby 2.4.0preview3 (2016-11-07 trunk 56661) [x86_64-darwin14]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
We can not call `BigDecimal("0.5").round(half: :up)`.
This prevents us from duck typing Float objects and BigDecimal objects.
```ruby
irb(main):001:0> require "bigdecimal"
=> true
irb(main):002:0> 0.5.round(half: :up)
=> 1
irb(main):003:0> BigDecimal("0.5").round(half: :up)
TypeError: no implicit conversion of Hash into Integer
from (irb):3:in `round'
from (irb):3
from /Users/kaneko/.rbenv/versions/2.4.0-preview3/bin/irb:11:in `<main>'
irb(main):004:0> BigDecimal.ver
=> "1.1.0"
```
--
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>