Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = -8.8;
y_correct = -8;
assert(isequal(round_zero(x),y_correct))
y =
-8
|
2 | Pass |
x = 8.8;
y_correct = 8;
assert(isequal(round_zero(x),y_correct))
y =
8
|
3 | Pass |
x = 0.8;
y_correct = 0;
assert(isequal(round_zero(x),y_correct))
y =
0
|
4 | Pass |
x = 0.4;
y_correct = 0;
assert(isequal(round_zero(x),y_correct))
y =
0
|
5 | Pass |
x = 0;
y_correct = 0;
assert(isequal(round_zero(x),y_correct))
y =
0
|
6 | Pass |
x = eps;
y_correct = 0;
assert(isequal(round_zero(x),y_correct))
y =
0
|
7 | Pass |
x = pi;
y_correct = 3;
assert(isequal(round_zero(x),y_correct))
y =
3
|
Return unique values without sorting
588 Solvers
349 Solvers
Longest run of consecutive numbers
1648 Solvers
249 Solvers
Flip the vector from right to left
2666 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!