@asmeurer I used this to handle infinite continued fractions. May be I can handle this scenario using iterator. What do you think?