2 Jun
2006
2 Jun
'06
12:50 a.m.
Wilson Castro wrote:
cl_I m; cl_I factor; cln::isqrt( n , &m); while( m > 1 ) { factor = cln::floor1( n, m*m); if( factor*(m*m) == n ) { cout << "sqrt( "<< n <<" ) = " << m << "*sqrt( "<< factor << " )" << endl; return ; } m = m - 1; }
Oh, it just occured to me: In order to speed up that program *without* changing the algorithm, you may wish to read about the functions square() and floor2() in the CLN manual. -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>