From bac188ce07b957807d4c649cb5d4e5e253360278 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 16 Aug 2024 14:24:20 -0400 Subject: Change division and modulus to use euclidean division, plus fix up a few integer bugs --- test/integers.tm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/integers.tm b/test/integers.tm index 55683500..36119f01 100644 --- a/test/integers.tm +++ b/test/integers.tm @@ -42,9 +42,9 @@ func main(): >> Int.random(1, 100) >> Int64.min - = -9223372036854775808 + = -9223372036854775808_i64 >> Int64.max - = 9223372036854775807 + = 9223372036854775807_i64 >> 123_i32:hex() @@ -75,3 +75,10 @@ func main(): >> super_big + 1 = 10000000000000000000000 + do: + for in 20: + >> n := Int.random(-999999, 999999) + >> d := Int.random(-999, 999) + //! n={n}, d={d}: + >> (n/d)*d + (n mod d) == n + = yes -- cgit v1.2.3