Cody

Solution 849372

Submitted on 11 Mar 2016 by Alexander
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(isequal(repeatingdec(1),'0'))

y = 1 out = 0

2   Pass
assert(isequal(repeatingdec(3/7),'428571'))

y = 0.4285714285714285 str = 428571

3   Pass
assert(isequal(repeatingdec(.3456345612323),''))

y = 0.3456345612323 str = 3456 str = 3456345612 str = 345634561232

4   Pass
assert(isequal(repeatingdec(1/pi),''))

y = 0.3183098861837907 str = 318 str = 31830988618

5   Pass
assert(isequal(repeatingdec(1/13),'076923'))

y = 0.07692307692307693 str = 076923

6   Pass
assert(isequal(repeatingdec(2/33),'06'))

y = 0.06060606060606061 str = 06

7   Pass
assert(isequal(repeatingdec(.789789789789789789),'789'))

y = 0.7897897897897898 str = 789

8   Pass
assert(isequal(repeatingdec(.78978978938383838),''))

y = 0.7897897893838384 str = 789 str = 789789

9   Pass
assert(isequal(repeatingdec(1/exp(1)),''))

y = 0.3678794411714423 str = 367879441171442

10   Pass
assert(isequal(repeatingdec(.78787878787833333),''))

y = 0.7878787878783333 str = 78 str = 7878 str = 787878 str = 78787878 str = 7878787878

11   Pass
assert(isequal(repeatingdec(.123451234512345),'12345'))

y = 0.123451234512345 str = 12345

12   Pass
assert(isequal(repeatingdec(1/100),''))

y = 0.01

13   Pass
assert(isequal(repeatingdec(1/62),''))

y = 0.01612903225806452 str = 016129 str = 016129032258

14   Pass
assert(isequal(repeatingdec(1/16),''))

y = 0.0625

15   Pass
assert(isequal(repeatingdec(1/91),'010989'))

y = 0.01098901098901099 str = 01 str = 010989

16   Pass
assert(isequal(repeatingdec(0),'0'))

y = 0 out = 0

Suggested Problems

More from this Author7