[JSCIENCE-72] LargeInteger#valueOf(BigInteger) returns incorrect result for -1 possibly others? Created: 10/Dec/07  Updated: 31/Jan/11

Status: Open
Project: jscience
Component/s: www
Affects Version/s: current
Fix Version/s: Version 6.0

Type: Bug Priority: Blocker
Reporter: hutchiko Assignee: jscience-issues
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: Mac OS X
Platform: Macintosh

Issuezilla Id: 72


Using version 4.3.1 LargeInteger#valueOf(BigInteger) converts the BigInteger
value "-1" into the LargeInteger value "-0":

assertEquals(-1, LargeInteger.valueOf(new BigInteger("-1")).intValue());

I have not investigated deeply but on face value this appears to be a missed
corner case.

My workaround is to use the String version of the factory:


Generated at Sun Nov 29 10:14:24 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.