Cody

Solution 1955384

Submitted on 2 Oct 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assert(numCmp('12.3456',12.3456))

ans = 12.3456 n2 = 12.345599999999999 tf = logical 1

2   Fail
assert(numCmp('12.3456',12.3456789))

ans = 12.345599999999999 n2 = 12.345678899999999 tf = logical 0

Assertion failed.

3   Pass
assert(~numCmp('12.3456',12.345))

ans = 12.345599999999999 n2 = 12.345000000000001 tf = logical 0

4   Pass
assert(~numCmp('12.34567890',12.3456))

ans = 12.345678899999999 n2 = 12.345599999999999 tf = logical 0

5   Pass
assert(numCmp('12e6',12e6))

ans = 12000000 n2 = 12000000 tf = logical 1

6   Pass
assert(~numCmp('54',100))

ans = 54 n2 = 100 tf = logical 0