jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-5533

Provide option to treat decimal literals as precise decimal values

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Extensions, Parser
  • Labels:
    None

Description

Prompted by: http://twitter.com/antonarhipov/status/40197610262237184

Under this scenario, RubyFloat will be backed by BigDecimal.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Hiro Asari added a comment - 23/Feb/11 2:35 PM

Additional input: http://www.ruby-forum.com/topic/199139

Show
Hiro Asari added a comment - 23/Feb/11 2:35 PM Additional input: http://www.ruby-forum.com/topic/199139
Hide
Permalink
Charles Oliver Nutter added a comment - 31/Jan/12 8:17 AM

As interesting an idea as this may be, I think we need to close this as wontfix. In Ruby, a Float is a float is a float, so we obviously can't unilaterally make it a BigDecimal. In addition, using BigDecimal by default would heavily impact Float performance.

I'd be willing to look over a patch to add this feature in even a brute-force way, just to see how it looks and feels. It would require extensive changes in RubyFloat (obviously) along with changes in the interpreter and compiler where we construct literal floats and in the parser where it parses them. It's a non-trivial amount of work for something we could never have enabled by default.

Show
Charles Oliver Nutter added a comment - 31/Jan/12 8:17 AM As interesting an idea as this may be, I think we need to close this as wontfix. In Ruby, a Float is a float is a float, so we obviously can't unilaterally make it a BigDecimal. In addition, using BigDecimal by default would heavily impact Float performance. I'd be willing to look over a patch to add this feature in even a brute-force way, just to see how it looks and feels. It would require extensive changes in RubyFloat (obviously) along with changes in the interpreter and compiler where we construct literal floats and in the parser where it parses them. It's a non-trivial amount of work for something we could never have enabled by default.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Hiro Asari
Vote (1)
Watch (1)

Dates

  • Created:
    23/Feb/11 12:03 PM
    Updated:
    31/Jan/12 8:17 AM
    Resolved:
    31/Jan/12 8:17 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.