checking for resemblance of x3 with x2 till two decimal places
let m = res * 100 ; let n = c * 100 ; m = Math . floor ( m ) ; n = Math . floor ( n ) ; if ( m == n ) break ; a = b ; b = c ; c = res ; if ( i > MAX_ITERATIONS ) { document . write ( " " + " " ) ; break ; } } if ( i <= MAX_ITERATIONS ) document . write ( " " + res . toFixed ( 4 ) ) ; }