fork(2) download
  1. def genContinuedFraction(p, q):
  2. while q != 0:
  3. p, q, r = q, p % q, p // q
  4. yield r
  5.  
  6. print([x for x in genContinuedFraction(1843987, 1000000)])
Success #stdin #stdout 0.01s 27704KB
stdin
Standard input is empty
stdout
[1, 1, 5, 2, 2, 3, 1, 2, 2, 1083]