From b4e46a9b408df5532f419312092d10c86d665b5e Mon Sep 17 00:00:00 2001 From: MadMaurice Date: Mon, 5 Apr 2021 03:53:44 +0200 Subject: [PATCH] Add tests for mod function --- t/math.t | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/t/math.t b/t/math.t index dc1e575..0f73f3d 100644 --- a/t/math.t +++ b/t/math.t @@ -14,3 +14,17 @@ (expect "max - 2 parameters" (= (max 5 30) 30)) (expect "min - 2 parameters" (= (min 5 30) 5)) + + +(comment (mod -1 5)) +(expect "mod - (mod -1 5) == 4" + (= (mod -1 5) 4)) + +(expect "mod - (mod 13 4) == 1" + (= (mod 13 4) 1)) + +(expect "mod - (mod 13.5 1) == 0.5" + (= (mod 13.5 1) 0.5)) + +(expect "mod - (mod -13.5 1) == 0.5" + (= (mod -13.5 1) 0.5))