[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
SXNzdWUgIzEyMTM0IGhhcyBiZWVuIHVwZGF0ZWQgYnkgTWFydGluIETDvHJzdC4KCgpUc3V5b3No
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74507] [Ruby trunk Bug#9810] Numeric#step behavior with mixed Float, String arguments inconsistent with documentation
From:
usa@...
Date:
2016-03-24 06:59:04 UTC
List:
ruby-core #74507
Issue #9810 has been updated by Usaku NAKAMURA.
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
Bug #9810: Numeric#step behavior with mixed Float, String arguments inconsistent with documentation
https://bugs.ruby-lang.org/issues/9810#change-57626
* Author: Brian Shirai
* Status: Closed
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* ruby -v: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
* Backport: 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
The `Numeric#step` documentation states:
"If any of the arguments are floating point numbers, all are converted to floats..."
https://github.com/ruby/ruby/blob/trunk/numeric.c#L1921
Is the following code intended to be described by that documentation?
```ruby
1.1.step(5.1, "1") {}
```
Previously (eg 2.0.0) resulted in a `TypeError`:
```
$ ruby -v -e 'p 1.1.step(5.1, "1") {}'
ruby 2.0.0p247 (2013-06-27) [x86_64-darwin13.0.1]
-e:1:in `step': no implicit conversion to float from string (TypeError)
from -e:1:in `<main>'
```
In 2.1.1, at least, an `ArgumentError` is raised:
```
$ ruby -v -e 'p 1.1.step(5.1, "1") {}'
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
-e:1:in `>': comparison of String with 0 failed (ArgumentError)
from -e:1:in `step'
from -e:1:in `<main>'
```
What's the intended behavior?
---Files--------------------------------
0001-Update-documentation-on-Numeric-step.patch (1.11 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>