1*433d6423SLionel Sambuc #include <minix/sysutil.h> 2*433d6423SLionel Sambuc sqrt_approx(u32_t in)3*433d6423SLionel Sambucu32_t sqrt_approx(u32_t in) 4*433d6423SLionel Sambuc { 5*433d6423SLionel Sambuc int b, v = 0; 6*433d6423SLionel Sambuc for(b = (sizeof(in)*8)/2-1; b >= 0; b--) { 7*433d6423SLionel Sambuc u32_t n = v | (1UL << b); 8*433d6423SLionel Sambuc if(n*n <= in) 9*433d6423SLionel Sambuc v = n; 10*433d6423SLionel Sambuc } 11*433d6423SLionel Sambuc 12*433d6423SLionel Sambuc return v; 13*433d6423SLionel Sambuc } 14*433d6423SLionel Sambuc 15