diff --git a/t/functions/302-floor-ceil-round.t b/t/functions/302-floor-ceil-round.t deleted file mode 100644 index 68a5454..0000000 --- a/t/functions/302-floor-ceil-round.t +++ /dev/null @@ -1,36 +0,0 @@ -plan(7); - -A = [2.3 4.5; 6.7 8.9]; -B = [2 4; 6 8]; -B1 = floor(A); -is(B1, B, "floor() on a matrix"); - -A = 10.2; -B = 10; -B1 = floor(A); -is(B1, B, "floor() on a scalar"); - -A = [2.3 4.5; 6.7 8.9]; -B = [3 5; 7 9]; -B1 = ceil(A); -is(B1, B, "ceil() on a matrix"); - -A = 20.3; -B = 21; -B1 = ceil(A); -is(B1, B, "ceil() on a scalar"); - -A = [2.3 4.5; 4.49 9.51]; -B = [2 5; 4 10]; -B1 = round(A); -is(B1, B, "round() on a matrix"); - -A = 10.49; -B = 10; -B1 = round(A); -is(B1, B, "round() on a scalar (round down)"); - -A = 10.50; -B = 11; -B1 = round(A); -is(B1, B, "round() on a scalar (round up)"); diff --git a/t/functions/ceil.t b/t/functions/ceil.t new file mode 100644 index 0000000..1e16fd2 --- /dev/null +++ b/t/functions/ceil.t @@ -0,0 +1,11 @@ +plan(2); + +A = [2.3 4.5; 6.7 8.9]; +B = [3 5; 7 9]; +B1 = ceil(A); +is(B1, B, "ceil() on a matrix"); + +A = 20.3; +B = 21; +B1 = ceil(A); +is(B1, B, "ceil() on a scalar"); diff --git a/t/functions/floor.t b/t/functions/floor.t new file mode 100644 index 0000000..f261448 --- /dev/null +++ b/t/functions/floor.t @@ -0,0 +1,11 @@ +plan(2); + +A = [2.3 4.5; 6.7 8.9]; +B = [2 4; 6 8]; +B1 = floor(A); +is(B1, B, "floor() on a matrix"); + +A = 10.2; +B = 10; +B1 = floor(A); +is(B1, B, "floor() on a scalar"); diff --git a/t/functions/round.t b/t/functions/round.t new file mode 100644 index 0000000..9654804 --- /dev/null +++ b/t/functions/round.t @@ -0,0 +1,16 @@ +plan(3); + +A = [2.3 4.5; 4.49 9.51]; +B = [2 5; 4 10]; +B1 = round(A); +is(B1, B, "round() on a matrix"); + +A = 10.49; +B = 10; +B1 = round(A); +is(B1, B, "round() on a scalar (round down)"); + +A = 10.50; +B = 11; +B1 = round(A); +is(B1, B, "round() on a scalar (round up)");