diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-06-26 13:06:47 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-06-26 13:06:47 -0400 |
| commit | 8a4d5dc57b14e7c947c25970bb4d4f4ef91450f4 (patch) | |
| tree | e36042760c7c22d5a08777939484c06830d73404 /src/stdlib/integers.h | |
| parent | c2653404944dbd5a6f737877f0bad6fd1de018f1 (diff) | |
Add get_bit() method for Ints and Bytes
Diffstat (limited to 'src/stdlib/integers.h')
| -rw-r--r-- | src/stdlib/integers.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/stdlib/integers.h b/src/stdlib/integers.h index 4eaac916..beb26bd6 100644 --- a/src/stdlib/integers.h +++ b/src/stdlib/integers.h @@ -29,6 +29,7 @@ Text_t type_name ## $hex(c_type i, Int_t digits, bool uppercase, bool prefix); \ Text_t type_name ## $octal(c_type i, Int_t digits, bool prefix); \ List_t type_name ## $bits(c_type x); \ + bool type_name ## $get_bit(c_type x, Int_t bit_index); \ Closure_t type_name ## $to(c_type first, c_type last, Optional ## type_name ## _t step); \ Closure_t type_name ## $onward(c_type first, c_type step); \ PUREFUNC Optional ## type_name ## _t type_name ## $parse(Text_t text); \ @@ -105,6 +106,7 @@ Int_t Int$abs(Int_t x); Int_t Int$power(Int_t base, Int_t exponent); Int_t Int$gcd(Int_t x, Int_t y); OptionalInt_t Int$sqrt(Int_t i); +bool Int$get_bit(Int_t x, Int_t bit_index); #define BIGGEST_SMALL_INT 0x3fffffff #define SMALLEST_SMALL_INT -0x40000000 |
