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

The square root operator implementation for fixed-point numbers #9

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

blewater
Copy link

  • Added the core sqrt function to Fixed, calculating the scaled square root and remainder.
  • Uses i128 for intermediate calculations (t = input.0 * SCALE_FACTOR) to avoid overflow.
  • Includes int_sqrt helper using Newton's method for u64.
  • Lots of unit tests for operator and constraint evaluation.

eval_fixed_sqrt Constraint (eval.rs):
Enforces the constraint out^2 + rem = input * SCALE_FACTOR

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.

2 participants