-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: math utilities for the frontscope #177
Conversation
Adds a new module `shared/math` that has some convenience functions for math in frontscope, especially for working with bigints. Specifically this first revision has safeNumber, for converting to a number with a check for loss of accuracy; floorSqrt for finding a bigint square root; modulo for the mathematician's modulo of bigints; and powmod for calculating a power of a number to some modulus (much more efficiently than exponentiating and then modding). Also provides documentation and tests for the new features and a guide to using bigints in frontscope. Resolves numberscope#163. Partially addresses numberscope#41. Does the first half of numberscope#172.
Note that the update to vite and the addition to vite.config.ts were necessitated because the previous setup caused |
Addition to the PR at Kate's request on Slack. |
I'm done with my review. Thanks for the changes, @gwhitney. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just some comments on the log functionality.
OK, have responded to all of your review comments. Let me know if anything else is needed for merge. |
Adds a new module
shared/math
that has some conveniencefunctions for math in frontscope, especially for working
with bigints.
Specifically this first revision has safeNumber, for
converting to a number with a check for loss of accuracy;
floorSqrt for finding a bigint square root; modulo for the
mathematician's modulo of bigints; and powmod for calculating
a power of a number to some modulus (much more efficiently than
exponentiating and then modding).
Also provides documentation and tests for the new features and
a guide to using bigints in frontscope.
Resolves #163.
Partially addresses #41.
Does the first half of #172.