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

Change BigIntNeg opcode into BigIntSub #4243

Closed
guipublic opened this issue Feb 2, 2024 · 0 comments
Closed

Change BigIntNeg opcode into BigIntSub #4243

guipublic opened this issue Feb 2, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@guipublic
Copy link
Contributor

Problem

The BigIntNeg opcode is not doing negation, but subtraction

Happy Case

Change the name so that it reflects what it is doing

Alternatives Considered

We could also change it so that it is a negation.

One reason to prefer sub over neg is that the bigint class represent integers modulo a fixed modulus, which is the case for regular unsigned integers in classical programming languages (and also in Noir). So the neg operation is a bit weird for an unsigned type.

Additional Context

No response

Would you like to submit a PR for this Issue?

Yes

Support Needs

No response

@guipublic guipublic added the enhancement New feature or request label Feb 2, 2024
@guipublic guipublic self-assigned this Feb 2, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Feb 2, 2024
guipublic added a commit to AztecProtocol/aztec-packages that referenced this issue Feb 5, 2024
Resolves noir issue: noir-lang/noir#4243

The bigint_neg opcode was implemented with a sub, instead of a negate as
the name suggest. The name has simply been changed to sub.
AztecBot pushed a commit to AztecProtocol/barretenberg that referenced this issue Feb 6, 2024
Resolves noir issue: noir-lang/noir#4243

The bigint_neg opcode was implemented with a sub, instead of a negate as
the name suggest. The name has simply been changed to sub.
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Feb 7, 2024
TomAFrench pushed a commit to AztecProtocol/aztec-packages that referenced this issue Feb 7, 2024
Resolves noir issue: noir-lang/noir#4243

The bigint_neg opcode was implemented with a sub, instead of a negate as
the name suggest. The name has simply been changed to sub.
michaelelliot pushed a commit to Swoir/noir_rs that referenced this issue Feb 28, 2024
Resolves noir issue: noir-lang/noir#4243

The bigint_neg opcode was implemented with a sub, instead of a negate as
the name suggest. The name has simply been changed to sub.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants