[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...

Issue #10333 has been updated by Koichi Sasada.

9 messages 2014/10/07

[ruby-core:65441] [ruby-trunk - Feature #10331] [Open] String#to_r to recognize negative denominators

From: sawadatsuyoshi@...
Date: 2014-10-06 14:44:18 UTC
List: ruby-core #65441
Issue #10331 has been reported by Tsuyoshi Sawada.

----------------------------------------
Feature #10331: String#to_r to recognize negative denominators
https://bugs.ruby-lang.org/issues/10331

* Author: Tsuyoshi Sawada
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
Current behavior or `String#to_r` does not recognize negative denominators. This can lead to confusing results:

~~~ruby
"1/-3".to_r
#=> (1/1)
~~~

I propose negative denominators to be recognized.

~~~ruby
"1/-3".to_r
#=> (-1/3)
~~~



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next