-
-
Notifications
You must be signed in to change notification settings - Fork 661
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. |
@Simn About this pull request is there any chance to be merged with Haxe 5.0 ( as this is a major change ) ?
|
This means that there is a function somewhere with too many variables in the same function scope for neko to be able to handle it. This is an updated error message for this issue which you reported: HaxeFoundation/neko#283. |
Thank you. |
Yes Neko is still relevant for Haxe 5. It should be possible to include BigInteger in Haxe 5; maybe we should discuss it during our next haxe-evolution meeting |
Does this mean that BigInt should be supported in Neko ? |
Almost all is green ,except for the CPP target ( timeout ).
|
I think everything is fine now. Cppia failed with an error "terminate called after throwing an instance of 'Dynamic'" which I don't think is related to this pull request. |
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