I wonder whether it it adequate to test correctness of double answers by equality. To do so discounts rounding errors and the fact that IEEE 754 does not guarantee the laws of arithmetic.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
a=4; b=3;
y_correct = pi*pi*7/4;
assert(isequal(you_fcn_name(a, b),y_correct))
|
2 | Pass |
a=5; b=3;
y_correct = pi*pi*8;
assert(isequal(you_fcn_name(a, b),y_correct))
|
3 | Pass |
a=2; b=1;
y_correct = pi*pi*3/4;
assert(isequal(you_fcn_name(a, b),y_correct))
|
3893 Solvers
819 Solvers
147 Solvers
Relative ratio of "1" in binary number
392 Solvers
274 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!