Float's multiplication is incorrect when used with non-built-in type (like
Rational)
------------------------------------------------------------------------------------
Key: JRUBY-1658
URL: http://jira.codehaus.org/browse/JRUBY-1658
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.x
Environment: Latest JRuby 1.1b1, built from trunk.
Reporter: Vladimir Sizikov
Attachments: float_rational_multiply.diff
require 'rational'
puts 1.0 + Rational(1, 5)
puts 1.0 * (10 ** -1)
In Ruby:
1.2
0.1
In JRuby:
1.0
0.0
This problem also leads to activesupport unit test failure:
2) Failure:
test_round_with_negative_precision(FloatExtRoundingTests)
[/opt/work/activesupport/./test/core_ext/float_ext_test.rb:22]:
<123460.0> expected but was
<0.0>.
The proposed patch fixes the problem as well as activesupport failure.
--
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