aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/bigint.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-13 13:44:11 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-13 13:44:11 -0500
commitceb375c0835e2d501550e1f1228184662415ef8e (patch)
tree2a28df3b183aae45d926e03312e7baa0d365f573 /src/stdlib/bigint.h
parentc2a60d9b4ff9f70505a6240e1e960e7c6230e4af (diff)
More approximate, but more functional implementation.
Diffstat (limited to 'src/stdlib/bigint.h')
-rw-r--r--src/stdlib/bigint.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdlib/bigint.h b/src/stdlib/bigint.h
index b57844a4..5bf33629 100644
--- a/src/stdlib/bigint.h
+++ b/src/stdlib/bigint.h
@@ -137,7 +137,7 @@ MACROLIKE Int_t Int$modulo1(Int_t x, Int_t y) {
}
MACROLIKE Int_t Int$left_shifted(Int_t x, Int_t y) {
- if likely (x.small & y.small & 1L) {
+ if likely (x.small & y.small & 1L & ((y.small >> 2L) < 30)) {
const int64_t z = ((x.small >> 2L) << (y.small >> 2L)) << 2L;
if likely (z == (int32_t)z) return (Int_t){.small = z + 1L};
}