Skip to content

Commit a386007

Browse files
committed
feat: support native u128
1 parent ee7b87f commit a386007

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Nodash is a utility library for [Noir](https://github.com/noir-lang/noir) langua
77
Put this into your Nargo.toml.
88

99
```toml
10-
nodash = { git = "https://github.com/olehmisar/nodash/", tag = "v0.39.7" }
10+
nodash = { git = "https://github.com/olehmisar/nodash/", tag = "v0.40.0" }
1111
```
1212

1313
## Docs

src/math/numeric.nr

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ impl Numeric for u64 {
3939
}
4040
}
4141

42+
impl Numeric for u128 {
43+
fn zero() -> Self {
44+
0
45+
}
46+
fn one() -> Self {
47+
1
48+
}
49+
}
50+
4251
impl Numeric for U128 {
4352
fn zero() -> Self {
4453
U128::from_integer(0)

src/math/sqrt.nr

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ mod tests {
6666
);
6767
}
6868

69+
#[test]
70+
fn test_sqrt_native_u128() {
71+
assert(sqrt(6 as u128) == 2);
72+
}
73+
6974
#[test]
7075
fn test_sqrt_many_numbers() {
7176
let pairs: [[Field; 2]] = &[

0 commit comments

Comments
 (0)