Cody

# Problem 918. Find the repeating decimal pattern!

Solution 849368

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

y = 1

Assertion failed.

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

y = 0.4285714285714285 str = 428571

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

y = 0.3456345612323 str = 3456

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

y = 0.3183098861837907 str = 318

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

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

y = 0.3678794411714423 str = 367879441171442

Assertion failed.

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

y = 0.7878787878783333 str = 78

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

y = 0.123451234512345 str = 12345

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

y = 0.01

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

y = 0.01612903225806452 str = 016129

Assertion failed.

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

y = 0.0625

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

y = 0.01098901098901099 str = 01

Assertion failed.

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

y = 0

Assertion failed.