-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BigInteger type #10750
base: development
Are you sure you want to change the base?
Add BigInteger type #10750
Conversation
Thanks, this would be useful to have in the standard library indeed. There are a couple of high-level comments I have (I haven't yet looked through all of the implementation):
|
Thank you for reviewing this pull request.
|
I think this pull request can be reviewed and merged as I added the missing methods ( abs, pow, modPow, isProbablePrime, getLowestSetBit and bitLength) and all the tests for them. |
Yes, this does indeed have my blessing. Hope it's a useful addition. 👍 Thank you @flashultra for doing this work! |
Php tests fails on another test. I think the bigint tests should pass the Php target. |
All tests are green except PHP ( and mac-cpp which failed with other reason) .
|
The above error is when I test with PHP 8.1. |
There is some problem with CI. Since I can't cancel the CI job, please someone to cancel CI #4960 as the new one (CI #4962) has been set. Some thoughts on this pull request. Any futher optimization will require a native Int64 type and/or Toom-Cook / Schonhage-Strassen implementation. |
CI is just completely broken at the moment it seems. |
This pull request add BigInteger type in Haxe . The implementation is created by Chuck Batson and I have his permission to relicense his code under the Haxe license ( thank you @cbatson ! ).
Some things about the current implementation. I compare three BigInteger implementations - on Chuck ( https://github.com/cbatson/hxBitcoin/tree/master/com/fundoware/engine/bigint) , in haxe-crypto lib ( https://github.com/Jens-G/haxe-crypto/blob/master/src/com/hurlant/math/BigInteger.hx ) and littleBigInt ( https://github.com/maitag/littleBigInt/blob/master/src/BigInt.hx ).
The Chuck implementation give about 5x better performance and also is better than native Java implementation ( 3x times better !).
As a additional info - many languages have a BigInteger , such as Java, C#, Javascript