Skip to content

Commit

Permalink
add floor, ceil, round files
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiteknight committed Nov 23, 2009
1 parent b30e3b0 commit ec06f75
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 36 deletions.
36 changes: 0 additions & 36 deletions t/functions/302-floor-ceil-round.t

This file was deleted.

11 changes: 11 additions & 0 deletions 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");
11 changes: 11 additions & 0 deletions 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");
16 changes: 16 additions & 0 deletions 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)");

0 comments on commit ec06f75

Please sign in to comment.