aboutsummaryrefslogtreecommitdiff
path: root/core/math/big/internal.odin
diff options
context:
space:
mode:
authorEd Yu <edyu@users.noreply.github.com>2024-03-04 10:14:51 -0800
committerEd Yu <edyu@users.noreply.github.com>2024-03-04 10:16:19 -0800
commitde41c2256d98e8b2e2742e6fd7266bdc2a5e970d (patch)
tree58de01cd396f52d10e4169e05a2d5f5e7106b3f2 /core/math/big/internal.odin
parent4c35633e0147b481dd7b2352d6bdb603f78c6dc7 (diff)
For invmod, b has to be > 1, fix a logic typo
Diffstat (limited to 'core/math/big/internal.odin')
-rw-r--r--core/math/big/internal.odin6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/math/big/internal.odin b/core/math/big/internal.odin
index 829cbf0e2..35c95f465 100644
--- a/core/math/big/internal.odin
+++ b/core/math/big/internal.odin
@@ -2046,9 +2046,9 @@ internal_int_inverse_modulo :: proc(dest, a, b: ^Int, allocator := context.alloc
if internal_is_positive(a) && internal_eq(b, 1) { return internal_zero(dest) }
/*
- `b` cannot be negative and has to be > 1
+ `b` cannot be negative and b has to be > 1
*/
- if internal_is_negative(b) || internal_gt(b, 1) { return .Invalid_Argument }
+ if internal_is_negative(b) || !internal_gt(b, 1) { return .Invalid_Argument }
/*
If the modulus is odd we can use a faster routine instead.
@@ -2954,4 +2954,4 @@ internal_zero_unused :: proc { internal_int_zero_unused, }
/*
========================== End of low-level routines ==========================
-*/ \ No newline at end of file
+*/