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: add RANGE_CHECK builtins #19

Merged

Conversation

KeneePatel
Copy link
Contributor

added RANGE_CHECK function

Time spent on this PR: 30 minutes

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

no function to range check.

Resolves #16

What is the new behavior?

Added a function RANGE_CHECK which takes num: bigint as an input and checks the range of the num. If the num < 2^128, it will throw an error, or else return num.

also: removed a console.log() which was slipped in and was not cleaned up.

@KeneePatel
Copy link
Contributor Author

KeneePatel commented May 27, 2024

I forgot to ask but should I keep the RC_BOUND const in the builtins.ts file or should I put that in constants.ts.

I felt the constant is only valid for range_check builtin so I put in builtins.ts, but lemme know if I should have put that in constants.ts.

Copy link
Owner

@ClementWalter ClementWalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment in the other PR, thx!

@KeneePatel
Copy link
Contributor Author

Shit I think I made an oops with rebasing ;-;
Lemme know if this will create any problem. I will branch through latest main again, and create a PR exactly same as this.

@ClementWalter ClementWalter force-pushed the feat/add_range_check_builtins branch from f20f620 to 4c209c7 Compare June 3, 2024 15:24
@ClementWalter ClementWalter merged commit 67ef53b into ClementWalter:main Jun 3, 2024
1 check passed
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.

range_check
2 participants