Skip to content

Commit

Permalink
chore(doc): Add docs for assert_max_bit_size (#4196)
Browse files Browse the repository at this point in the history
# Description


Resolves #4135
## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [ ] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

Signed-off-by: Kevaundray Wedderburn <[email protected]>
  • Loading branch information
kevaundray authored Jan 29, 2024
1 parent 2e26530 commit ebdb24f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/docs/noir/concepts/data_types/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,23 @@ fn main() {
}
```

### assert_max_bit_size

Adds a constraint to specify that the field can be represented with `bit_size` number of bits

```rust
fn assert_max_bit_size(self, bit_size: u32)
```

example:

```rust
fn main() {
let field = 2
field.assert_max_bit_size(32);
}
```

### sgn0

Parity of (prime) Field element, i.e. sgn0(x mod p) = 0 if x ∈ \{0, ..., p-1\} is even, otherwise sgn0(x mod p) = 1.
Expand Down

0 comments on commit ebdb24f

Please sign in to comment.