| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Euler.Util.Decimal
Synopsis
- repetendLength :: Rational -> Int
Documentation
repetendLength :: Rational -> Int Source #
The length of the repeating portion of a rational number's decimal representation. If a decimal doesn't repeat, its repetend length is 0.
>>>[repetendLength (1/n) | n <- [1..10]][0,0,1,0,0,1,6,0,1,0]
>>>repetendLength (608/615) -- 0.9(88617)5