aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/bigint.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2026-01-11 23:03:00 -0500
committerBruce Hill <bruce@bruce-hill.com>2026-01-11 23:03:00 -0500
commit6894dc69374efcc23619e93b040a4224588054cd (patch)
tree045adf796e3291349b02d695b24e390929c8446e /src/stdlib/bigint.h
parentb97ea6b6ac3498b21321e1f93ccc1a2dd145e9d7 (diff)
Refactor some AST logic to keep Ints/Reals as "Integer" and "Number" AST
nodes and use improved parsing logic from Int/Real
Diffstat (limited to 'src/stdlib/bigint.h')
-rw-r--r--src/stdlib/bigint.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stdlib/bigint.h b/src/stdlib/bigint.h
index ae95b224..2c93b5ec 100644
--- a/src/stdlib/bigint.h
+++ b/src/stdlib/bigint.h
@@ -47,7 +47,8 @@ bool Int$get_bit(Int_t x, Int_t bit_index);
#define I_small(i) ((Int_t){.small = (int64_t)((uint64_t)(i) << 2L) | 1L})
#define I(i) _Generic(i, int8_t: I_small(i), int16_t: I_small(i), default: Int$from_int64(i))
-#define I_is_zero(i) ((i).small == 1L)
+#define Int$is_zero(i) ((i).small == 1L)
+#define Int$is_small(i) (((i).small & 1L) == 1L)
Int_t Int$slow_plus(Int_t x, Int_t y);
Int_t Int$slow_minus(Int_t x, Int_t y);