[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:73995] [Ruby trunk Bug#9810] Numeric#step behavior with mixed Float, String arguments inconsistent with documentation
From:
nobu@...
Date:
2016-02-26 01:01:25 UTC
List:
ruby-core #73995
Issue #9810 has been updated by Nobuyoshi Nakada.
Description updated
[Developers' meeting log][1]
> This issue is because of invalid type, not mismatch the number of arguments.
> Comparison `String` with `Numeric` should raise `TypeError`
>
> matz: I once thought type mismatch also infringe the contract of arguments, therefore it can be `ArgumentError` but now they should be separated.
>
> matz: It should raise `TypeError`.
[1]: https://docs.google.com/document/d/1rj7ODOCSfcsQeBd6-p-NiVwqxDUg05G66LwDOkKOGTw/pub
----------------------------------------
Bug #9810: Numeric#step behavior with mixed Float, String arguments inconsistent with documentation
https://bugs.ruby-lang.org/issues/9810#change-57146
* Author: Brian Shirai
* Status: Assigned
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* ruby -v: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
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:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>