This repository was archived by the owner on Nov 16, 2022. It is now read-only.
Int64 & some questions #3
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
for one of my projects I'm in need of both Int64 and Int128 implementations. What I'm looking for is classes supporting all the operations that classical Int has (and easily drop them in - thing that haxe.Int64 makes not possible currently even using static extensions).
Your Int128 seem to go that way and looks quite promising (although still lacking some things, as you pointed out in comments).
I've played a bit with your abstract and made some additions to a Int64 class (copied from Int128). I cheated by using haxe.Int64 in some places, but having a working toString() really sped up my tests.
This is really not meant as a PR, I'm just sending it for the purpose of discussing some things.
A few:
I'm going to experiment more with your classes, and hopefully contribute in some way.
EDIT: I stumbled upon this [http://stackoverflow.com/questions/2566010/fastest-way-to-calculate-a-128-bit-integer-modulo-a-64-bit-integer](SO answer), and it seems quite interesting (haven't tried it yet)