Project

General

Profile

Actions

Feature #10332

open

Rational literal for mixed fractions

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

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

Description

Current behavior of rational literal and String#to_r does not recognize mixed fractions. Mixed fraction is not rare, and is frequently used in places such as US length measurement.

drill bits

I propose that rational literal and String#to_r should be extended to handle mixed fractions. Perhaps something like:

8 1/2r #=> (17/2)
"8 1/2".to_r #=> (17/2)

or

(8 1/2)r #=> (17/2)

No data to display

Actions

Also available in: Atom PDF

Like0