Continuous Fractions
问题 My understanding of continuous fractions was that it will always give a representation of a decimal in fraction form. I thought that continuous fraction would always return value less than or equal to the decimal number. Unfortunately my code occasionally returns fractional values greater than the decimal input. Is my understanding of continuous fractions correct? If so can you please explain where in my code the error lies. public static Rational contFrac(double a, int i,int n){ if(i<n){