Skip to content

fix: don't cast numbers to bool#51

Merged
asterite merged 1 commit into
mainfrom
ab/do-not-cast-to-bool
Jun 2, 2025
Merged

fix: don't cast numbers to bool#51
asterite merged 1 commit into
mainfrom
ab/do-not-cast-to-bool

Conversation

@asterite
Copy link
Copy Markdown
Contributor

@asterite asterite commented May 30, 2025

Description

Problem

For noir-lang/noir#8703

Summary

I wasn't sure if the resulting Field casted to bool was always zero or one but I verified that (x - y) * p + y always gives 0 or 1.

Additional Context

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@asterite asterite merged commit 349c60b into main Jun 2, 2025
10 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 To Triage to ✅ Done in Noir Libraries Jun 2, 2025
@asterite asterite deleted the ab/do-not-cast-to-bool branch June 2, 2025 11:42
@github-actions github-actions Bot mentioned this pull request Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants