aboutsummaryrefslogtreecommitdiff
path: root/core/math/big
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2024-06-29 23:14:12 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2024-06-29 23:14:12 +0200
commit476d0087c8d47102c23cf6de71eb4014b9a7b6b2 (patch)
tree37a2d4d8056d531a0f79962fdd5dd08bd1653c16 /core/math/big
parent34fce83d668f1f1754e88c29a8f0e3df71c60057 (diff)
Fix bug in div3 fast path.
Diffstat (limited to 'core/math/big')
-rw-r--r--core/math/big/private.odin2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/big/private.odin b/core/math/big/private.odin
index 220f39871..bb6b9497c 100644
--- a/core/math/big/private.odin
+++ b/core/math/big/private.odin
@@ -975,7 +975,7 @@ _private_int_div_3 :: proc(quotient, numerator: ^Int, allocator := context.alloc
q.sign = numerator.sign
w, t: _WORD
- #no_bounds_check for ix := numerator.used; ix >= 0; ix -= 1 {
+ #no_bounds_check for ix := numerator.used - 1; ix >= 0; ix -= 1 {
w = (w << _WORD(_DIGIT_BITS)) | _WORD(numerator.digit[ix])
if w >= 3 {
/*