Cody

Solution 1808394

Submitted on 7 May 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
d = 1; x = 1; y_correct = 1; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 1

2   Fail
d = 10; x = 5; y_correct = 0.1000; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0

Assertion failed.

3   Fail
d = 10; x = 1; y_correct = 0.2000; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0.1000

Assertion failed.

4   Fail
d = 20; x = 9; y_correct = 0.0500; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0

Assertion failed.

5   Fail
d = 50; x = 0; y_correct = 0.0400; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0.0200

Assertion failed.

6   Fail
d = 50; x = 2; y_correct = 0.2600; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0.0400

Assertion failed.

7   Fail
d = 1000; x = 9; y_correct = 0.0670; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0.0260

Assertion failed.

8   Fail
d = 1e4; x = 8; y_correct = 0.0747; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0.0383

Assertion failed.

9   Fail
d = 1e5; x = 7; y_correct = 0.0864; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0.0470

Assertion failed.

10   Fail
d = 1e6; x = 6; y_correct = 0.0935; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0.0543

Assertion failed.

11   Fail
d = 1e6; x = 5; y_correct = 0.0937; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0.0543

Assertion failed.

12   Fail
d = 2e6; x = 4; y_correct = 0.0903; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0.0543

Assertion failed.

13   Fail
d = 2000124; x = 3; y_correct = 0.1162; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

c = 0.0543

Assertion failed.