From e49fcd3449fb8d99f84c7f3151c2321b8f3055a1 Mon Sep 17 00:00:00 2001 From: dzaima Date: Wed, 17 Aug 2022 19:41:32 +0300 Subject: [PATCH] =?UTF-8?q?typed=20n=20=E2=80=A2rand.Range=202=E2=8B=8631?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/sysfn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtins/sysfn.c b/src/builtins/sysfn.c index e3816e0d..c4ea3acd 100644 --- a/src/builtins/sysfn.c +++ b/src/builtins/sysfn.c @@ -334,7 +334,7 @@ B rand_range_c2(B t, B w, B x) { if (max!=0) thrM("(rand).Range: 𝕩 cannot be negative"); f64* rp; r = m_f64arrp(&rp, am); NOUNROLL for (usz i = 0; i < am; i++) rp[i] = wy2u01(wyrand(&seed)); - } else if (max > I32_MAX) { + } else if (max > (1ULL<<31)) { if (max >= 1LL<<53) thrM("(rand).Range: 𝕩 must be less than 2⋆53"); f64* rp; r = m_f64arrp(&rp, am); NOUNROLL for (usz i = 0; i < am; i++) rp[i] = wy2u0k(wyrand(&seed), max);