diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-16 14:24:20 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-16 14:24:20 -0400 |
| commit | bac188ce07b957807d4c649cb5d4e5e253360278 (patch) | |
| tree | 928a64f7947fedeb73836566df2668bea4e75868 /test | |
| parent | 04714e00d781235590553446301ac7e5818b3455 (diff) | |
Change division and modulus to use euclidean division, plus fix up a few
integer bugs
Diffstat (limited to 'test')
| -rw-r--r-- | test/integers.tm | 11 |
1 files changed, 9 insertions, 2 deletions
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 |
