rakuten / as3crypto

Automatically exported from code.google.com/p/as3crypto
0 stars 1 forks source link

new BigInteger("0", 10) is not equal to BigInteger.nbv(0) #73

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. trace("0==0: "+BigInteger.nbv(0).equals(new BigInteger("0", 10))); // false
2. trace("0==0: "+BigInteger.ZERO.equals(new BigInteger("0", 10))); // false
3. trace("0==0: "+BigInteger.ZERO.equals(BigInteger.nbv(0))); // true

What is the expected output? What do you see instead?
The first two should be true.

What version of the product are you using? On what operating system?
as3crypto v1.3

Please provide any additional information below.
1. new BigInteger("0", 10)
a: [0]
   length: 1
s: 0
t: 1

2. BigInteger.nbv(0) and BigInteger.ZERO
a: []
   length: 0
s: 0
t: 0

BigInteger.equals does a comparison of the value t which is not the same 
depending on the method of construction.

Original issue reported on code.google.com by den...@dennisobrien.net on 29 May 2012 at 8:54