Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!mcnc!rti!trt From: trt@rti.UUCP (Thomas Truscott) Newsgroups: comp.lang.c Subject: Re: sqroot of a 2**n number ? Summary: Table look up works well Message-ID: <2955@rti.UUCP> Date: 15 May 89 04:04:18 GMT References: <1906@yunexus.UUCP> <1094@atanasoff.cs.iastate.edu> Organization: Research Triangle Institute, RTP, NC Lines: 36 > In article <1906@yunexus.UUCP> oz@yunexus.UUCP (Ozan Yigit) writes: > >given any number that is an exact power of two, finding the square > >root: this can be done by counting to the bit position on some > >architectures. Does anyone know of a really portable version of this ... I believe the following is portable code: /* "n" is type "int", exact positive power of two */ int i; for (i = 0; (1<