Integer#prime_division from mathn library handles negative integers incorrectly
-------------------------------------------------------------------------------
Key: JRUBY-4243
URL: http://jira.codehaus.org/browse/JRUBY-4243
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules, RubySpec
Affects Versions: JRuby 1.4
Reporter: Vladimir Sizikov
jruby -rmathn -e "p -26.prime_division" ==> [[2,1]]
Which is obviously wrong. This bug comes with MRI library. It has been fixed in
MRI 1.9.2, and the proper result is:
[[-1, 1], [2, 1], [13, 1]]
This also causes one rubyspec failure:
{noformat}
Integer#prime_division Performs a prime factorization of a negative integer
FAILED
Expected [[2, 1]]
to equal [[-1, 1], [2, 1], [13, 1]]
/opt/work/rubyspec.git/library/mathn/integer/prime_division_spec.rb:13
/opt/work/rubyspec.git/library/mathn/integer/prime_division_spec.rb:4
/opt/work/rubyspec.git/library/mathn/integer/prime_division_spec.rb:55:in `load'
{noformat}
--
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