dartist / dart-bignum

Other
14 stars 11 forks source link

Fix to recent dart #9

Closed drt24 closed 11 years ago

drt24 commented 11 years ago

Multiple fixes to make the library work with recent dart and to point in the documentation to the correct site now that it has moved. Also implement truncating division as that was one line and caused a Unimplemented exception when I was using the library.

adam-singer commented 11 years ago

Could you possibly add the patch from https://github.com/financeCoding/dart-bignum/issues/8 into this pull request?

drt24 commented 11 years ago

The optimisation might make it slightly faster but it doesn't speed up repeated runs of the test suite by all that much and I don't think my timing measurements of it were statistically significant though they showed as small improvement.

adam-singer commented 11 years ago

Did you try dartvm vs compiled to javascript in performance measures?

Btw, I'm going to merge this, thanks for the pull. Is this a project you plan to continue to investigate? Just wondering what your using it for.

drt24 commented 11 years ago

I only looked at dartvm performance which is potentially a mistake. I need a BigInteger implementation to do DSA in dart. Dart has no crypto support :-(

adam-singer commented 11 years ago

fwiw, the native vm has infinite integers, scalar lists and a fixed integer library. This library was ment to support the issue of compiling down to javascript. Also this library has some bugs with shifting when compiled to javascript, the bugs are due to the way dart2js does right shift. I'm definitely interested in a DSA implementation, anything I could help you out with please let me know.

drt24 commented 11 years ago

The dart VM claims to have infinite integers but doesn't actually implement all the integer functions for big integers (e.g. pow) it also lacks some functions (like modPow). I will need it to work in js later though.

adam-singer commented 11 years ago

great, this library might be a good match for you then :+1: