#12174 closed defect (fixed)
dojox.math.BigInteger not usable with base 10
Reported by: | rdunklau | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | Dojox | Version: | 1.6.0b1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
I tried to use dojox.math.BigInteger to perform client-side checksum calculation, and I stumbled upon several bugs.
Steps to reproduce: Executes the attached code. Note that it succeeds at instantiating bigints in base 16, but not in base 10.
Solutions: It seems that some functions are not properly exported from BigInteger to BigInteger-ext. For example, the fromRadix method is accessed as if it were public in BigInteger, although it is only defined in BigInteger-ext and as a protected method (named _fromRadix). Same goes for the intAt function, defined in BigInteger, and not exported in the namespace to be used by BigInteger-ext.
I'm willing to submit a patch and a CLA for these.
Attachments (1)
Change History (8)
Changed 11 years ago by
Attachment: | testcase.js added |
---|
comment:1 follow-up: 2 Changed 11 years ago by
Component: | General → Dojox |
---|---|
Description: | modified (diff) |
Owner: | changed from anonymous to Eugene Lazutkin |
comment:2 Changed 11 years ago by
Status: | new → assigned |
---|
I'm willing to submit a patch and a CLA for these.
Please do both.
comment:3 Changed 11 years ago by
Milestone: | tbd → future |
---|
comment:4 Changed 11 years ago by
Hi rdunklau,
is it possible to provide the patch? We are struggling with the same issue. Many thanks in advance.
For general curiosity: Why is the big int library splitted up into two modules?
-thx Halm
comment:5 Changed 10 years ago by
The following was failing for me (on dojo-release-1.8.0b1):
require([ 'dojox/math/BigInteger', 'dojox/math/BigInteger-ext' ], function(BigInteger) { var i = new BigInteger("1234", 10); });
with the message "Object 0 has no method 'fromRadix'".
I fixed the issue by fixing the call to fromRadix in function bnpFromString of BigInteger? (it was missing a leading _):
else { this._fromRadix(s,b); return; }
It looks like the same issue as on this ticket.
I signed a CLA years ago if it helps (don't think a 1 character bugfix can really have copyright issues anyway).
comment:7 Changed 10 years ago by
Milestone: | future → 1.8 |
---|
Looks like Eugene owns this file?