We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
headius
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# jruby -v jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d OpenJDK 64-Bit Server VM 25.72-b15 on 1.8.0_72-b15 +jit [linux-amd64]
# irb 2.3.0 :001 > require 'bigdecimal' => true 2.3.0 :002 > BigDecimal.new("5").to_f => 5.0 2.3.0 :003 > BigDecimal.new("5").to_r.to_f => 5.0 2.3.0 :004 > BigDecimal.new("5").to_r => (5/1) 2.3.0 :005 > BigDecimal.new("1234.56789").to_r => (123456789/100000)
# irb jruby-9.0.5.0 :001 > require 'bigdecimal' => true jruby-9.0.5.0 :002 > BigDecimal.new("5").to_f => 5.0 jruby-9.0.5.0 :003 > BigDecimal.new("5").to_r.to_f => 1.0 jruby-9.0.5.0 :004 > BigDecimal.new("5").to_r => (1/1) jruby-9.0.5.0 :005 > BigDecimal.new("1234.56789").to_r => (123456789/50)
The text was updated successfully, but these errors were encountered:
I'm not able to reproduce it in master. cc @kares @felixvf
master
# irb >> require 'bigdecimal' => true >> BigDecimal.new("5").to_f => 5.0 >> BigDecimal.new("5").to_r.to_f => 5.0 >> BigDecimal.new("5").to_r => (5/1) >> BigDecimal.new("1234.56789").to_r => (123456789/100000) >> JRUBY_VERSION => "9.1.0.0-SNAPSHOT"
Sorry, something went wrong.
I also tried reproducing the bug and had the same output as lucasallan, BigDecimal appears to be fine in 9.1
EDIT:
irb(main):001:0> require 'bigdecimal' => true irb(main):002:0> BigDecimal.new("5").to_f => 5.0 irb(main):003:0> BigDecimal.new("5").to_r.to_f => 5.0 irb(main):004:0> BigDecimal.new("5").to_r => (5/1) irb(main):005:0> BigDecimal.new("1234.56789").to_r => (123456789/100000) irb(main):006:0>
(Having troubles to show the version)
thanks, it seems to be a duplicate of #3616 which has been fixed with 16b13e1
backport BigDecimal .to_r for jruby#3728
c69832c
Merge pull request #3927 from ahorek/backport_to_r_fix
2005fa7
backport BigDecimal .to_r for #3728
No branches or pull requests
Environment
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: