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

feat: math utilities for the frontscope #177

Merged
merged 4 commits into from
Oct 27, 2022

Conversation

gwhitney
Copy link
Collaborator

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 #163.
Partially addresses #41.
Does the first half of #172.

  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.
@gwhitney
Copy link
Collaborator Author

Note that the update to vite and the addition to vite.config.ts were necessitated because the previous setup caused npm run dev to barf on bigint literals, cf. jonathanpmartins/v-money3#70 (comment)

@gwhitney
Copy link
Collaborator Author

Addition to the PR at Kate's request on Slack.

@liammulh
Copy link
Member

I'm done with my review. Thanks for the changes, @gwhitney.

Copy link
Member

@katestange katestange left a 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.

@gwhitney
Copy link
Collaborator Author

OK, have responded to all of your review comments. Let me know if anything else is needed for merge.

@katestange katestange merged commit 79482f6 into numberscope:main Oct 27, 2022
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

Successfully merging this pull request may close these issues.

Make "Intro to working with BigInts" document
3 participants