Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!helios.ee.lbl.gov!epb2!envbvs From: envbvs@epb2.lbl.gov (Brian V. Smith) Newsgroups: comp.lang.c Subject: Re: sqroot of a 2**n number ? Message-ID: <2643@helios.ee.lbl.gov> Date: 14 May 89 16:27:02 GMT References: <1906@yunexus.UUCP> <4890@umd5.umd.edu> <1928@yunexus.UUCP> Sender: usenet@helios.ee.lbl.gov Reply-To: envbvs@epb2 (Brian V. Smith) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 23 In article <1928@yunexus.UUCP> oz@yunexus.UUCP (Ozan Yigit) writes: >In article <4890@umd5.umd.edu> setzer@wam.umd.edu writes: > >>int sqrt_of_2_to_the_n(n) >>int n; >>{ >> return (1 << (n / 2)); /* integer division */ >>} >Say what ?? (1 << (16 / 2) == 256 !!! I always thought sqrt(16) == 4. Try reading the name of the function. It returns the square root of 2**n, not n! >use the source, luke !! Usenet: oz@nexus.yorku.ca Use the brain, luke !! _____________________________________ Brian V. Smith (bvsmith@lbl.gov) Lawrence Berkeley Laboratory We don't need no signatures!