Float divided by BigDecimal incorrectly coerced to Fixnum
---------------------------------------------------------
Key: JRUBY-2568
URL: http://jira.codehaus.org/browse/JRUBY-2568
Project: JRuby
Issue Type: Bug
Reporter: Paul Cantrell
Assignee: Thomas E Enebo
JRuby incorrectly coerces an expr of the form (Float / BigDecimal) to Fixnum
instead of Float.
{quote}
odysseus (~)$ jruby -v
ruby 1.8.6 (2008-04-22 rev 6555) [ppc-jruby1.1.1]
odysseus (~)$ jruby -S irb
irb(main):001:0> require 'bigdecimal'
=> true
irb(main):002:0> {color:red}2.0 / BigDecimal.new('3.0') # Same expr gives Float
0.666666666666667 in MRI{color}
=> {color:red}0{color}
irb(main):003:0> 2 / BigDecimal.new('3.0') {color:green}# Oddly, this
works...{color}
=>
#<BigDecimal:e6c526,'0.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667E0',200(204)>
irb(main):004:0> BigDecimal.new('3.0') / 2.0 {color:green}# ...and so does
this{color}
=> 1.5
{quote}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email