I've read recently that any number with infinite continued fraction is irrational. See this continued fraction below
https://www.wolframalpha.com/input/?i=continued+fraction+of+the+cosine If I substitute x for $\frac{\pi}{2}$ I will get zero on the left side, but the continued fraction is infinite because its convergent ones never cancel out. Could anyone explain me this?