Project

General

Profile

Actions

Feature #10331

open

String#to_r to recognize negative denominators

Added by sawa (Tsuyoshi Sawada) over 9 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:65441]

Description

Current behavior or String#to_r does not recognize negative denominators. This can lead to confusing results:

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

I propose negative denominators to be recognized.

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

No data to display

Actions

Also available in: Atom PDF

Like0