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

Are negative numbers supported? #77

Closed
olehmisar opened this issue Dec 13, 2024 · 1 comment
Closed

Are negative numbers supported? #77

olehmisar opened this issue Dec 13, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@olehmisar
Copy link
Contributor

Can't find anything in the README

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Dec 13, 2024
@ewynx
Copy link
Contributor

ewynx commented Jan 9, 2025

Since a BigNum is a number modulo the modulus you are using, the concept of a "negative" element doesn't really exist. Also, when you use the predefined sets U256, U384, U512 etc, those are for unsigned integers.

On the other hand, when working modulo a number p, there is a wrap around so p-x would be the representation for "-x" and you could do arithmetic with those values. Edit: for example, neg functionality is available see here and this uses the wraparound, see here)

The README was updated yesterday, so maybe it's clearer now

@Savio-Sou Savio-Sou removed this from Noir Jan 15, 2025
@Savio-Sou Savio-Sou added documentation Improvements or additions to documentation question Further information is requested labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants