Skip to content
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 fast lexers for Integer and Natural #3

Open
treeowl opened this issue Oct 11, 2016 · 0 comments
Open

Add fast lexers for Integer and Natural #3

treeowl opened this issue Oct 11, 2016 · 0 comments

Comments

@treeowl
Copy link

treeowl commented Oct 11, 2016

Bertram Felgenhauer has written one for strings that should translate well for decimal conversion.

byteArrayToBigNat# should let you write something absurdly fast for hexadecimal and (if you think it's worth the trouble) octal. Count the digits to determine how many bytes you need, round up to the nearest multiple of the word size, allocate a MutableByteArray#, fill it up with words (I think) smallest first, unsafe freeze it, and then convert for free. Special case numbers that fit in one word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant