XilinxProcessorIPLib/drivers/v_warp_init/src/xv_warp_init_utils.c
unsigned int XVWarpInit_Sqrt(unsigned int v)
{
	unsigned int t, q, b, r, i;
	r = v;
	b = 0x40000000;
	q = 0;
	for(i=0; i < 16; i++)
	{
		t = q + b;
		q >>= 1;
		if (r >= t)
		{
			r -= t;
			q += b;
		}
		b >>= 2;
	}
	return q;
}
/*****************************************************************************/
/**
* This function computes sqaure root of positive integer
*
* @param  v, integer value for calculating square root.
*
* @return square root of input v
*
******************************************************************************/
This function computes sqaure root of positive integer
This function computes sqaure root of positive integer
unsigned int XVWarpInit_Sqrt(unsigned int v)
{
	unsigned int t, q, b, r, i;
	r = v;
	b = 0x40000000;
	q = 0;
	for(i=0; i < 16; i++)
	{
		t = q + b;
		q >>= 1;
		if (r >= t)
		{
			r -= t;
			q += b;
		}
		b >>= 2;
	}
	return q;
}
unsigned int XVWarpInit_Sqrt ( unsigned int v ) { unsigned int t , q , b , r , i ; r = v ; b = 0x40000000 ; q = 0 ; for ( i = 0 ; i < 16 ; i ++ ) { t = q + b ; q >>= 1 ; if ( r >= t ) { r -= t ; q += b ; } b >>= 2 ; } return q ; }
This function computes sqaure root of positive integer
This function computes sqaure root of positive integer