Path: chuka.playstation.co.uk!news From: "Kenny Millar" Newsgroups: scee.yaroze.freetalk.english Subject: Re: sqrt function. Date: Mon, 27 Oct 2003 10:08:14 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 90 Message-ID: References: NNTP-Posting-Host: cpc3-kirk1-6-0-cust103.renf.cable.ntl.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Thanks Andrew, that solves the problem. -Kenny "Andrew Partington" wrote in message news:bn9ro2$m4k24@www.netyaroze-europe.com... > Hi Kenny, > > Is this the sqrt() function in the standard maths lib you're talking > about? > > If so, I can't help you, but I curently use the following code for doing > square roots, I think I may have found it on a Yaroze members website or > on the newsgroups, but i'm not sure who the author really is. > > Maybe this one will work for you - it's reputed to be quicker than the > standard one anyway. > > Cheers, > > Andy P > > > > #define STEP(k) s=r+(1L<>=1;if(s<=v){v-=s;r|=(1L< > > > unsigned long sqrt_u_32(unsigned long n) > > { > > unsigned long r=0,s,v=n; > > > > STEP(15);STEP(14);STEP(13);STEP(12); > > STEP(11);STEP(10);STEP(9);STEP(8); > > STEP(7);STEP(6);STEP(5);STEP(4); > > STEP(3);STEP(2);STEP(1);STEP(0); > > return r; > > } > > unsigned short sqrt_u_16(unsigned short n) > > { > > register unsigned short r=0,s,v=n; > > > > STEP(7);STEP(6);STEP(5);STEP(4); > > STEP(3);STEP(2);STEP(1);STEP(0); > > return r; > > } > > > Kenny Millar wrote: > > Hi all, > > > > I finally got my build environment to work under XP Pro. > > > > However, using FCC 2.8.1 - whenever I use the sqrt function the PSX hangs > > completly. > > > > even just doing this.... > > > > x=sqrt(16); > > > > hangs the console. > > > > Anyone else using sqrt having this trouble? > > > > -Kenny > > > > > > >