diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-11-03 22:37:48 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-11-03 22:37:48 -0500 |
| commit | fc9a6f1416be514e9d26b301d05e7e347560560b (patch) | |
| tree | 7d61cc3657c36dde05135f17dbf5923cff177abf /stdlib/integers.h | |
| parent | 52e3d3fe6f2c3e5051affe155fed364d1a5d623c (diff) | |
Add RNGs to the language
Diffstat (limited to 'stdlib/integers.h')
| -rw-r--r-- | stdlib/integers.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/stdlib/integers.h b/stdlib/integers.h index 04699162..b441e2be 100644 --- a/stdlib/integers.h +++ b/stdlib/integers.h @@ -34,8 +34,6 @@ 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); \ Array_t type_name ## $bits(c_type x); \ - c_type type_name ## $random(c_type min, c_type max); \ - c_type type_name ## $full_random(void); \ to_attr Range_t type_name ## $to(c_type from, c_type to); \ PUREFUNC Optional ## type_name ## _t type_name ## $from_text(Text_t text); \ MACROLIKE PUREFUNC c_type type_name ## $clamped(c_type x, c_type min, c_type max) { \ @@ -103,8 +101,6 @@ PUREFUNC bool Int$equal_value(const Int_t x, const Int_t y); Text_t Int$format(Int_t i, Int_t digits); Text_t Int$hex(Int_t i, Int_t digits, bool uppercase, bool prefix); Text_t Int$octal(Int_t i, Int_t digits, bool prefix); -void Int$init_random(long seed); -Int_t Int$random(Int_t min, Int_t max); PUREFUNC Range_t Int$to(Int_t from, Int_t to); OptionalInt_t Int$from_str(const char *str); OptionalInt_t Int$from_text(Text_t text); @@ -127,7 +123,7 @@ Int_t Int$sqrt(Int_t i); } while (0) #define I(i) ((int64_t)(i) == (int32_t)(i) ? ((Int_t){.small=(int64_t)((uint64_t)(i)<<2)|1}) : Int64_to_Int(i)) -#define I_small(i) ((Int_t){.small=((uint64_t)(i)<<2)|1}) +#define I_small(i) ((Int_t){.small=(int64_t)((uint64_t)(i)<<2)|1}) #define I_is_zero(i) ((i).small == 1) Int_t Int$slow_plus(Int_t x, Int_t y); |
