sqroot of a 2**n number ?

Ozan Yigit oz at yunexus.UUCP
Sun May 14 07:56:30 AEST 1989


In article <4890 at umd5.umd.edu> setzer at 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.

oz
-- 
use the source, luke !!     	        Usenet:    oz at nexus.yorku.ca
uh... we forgot to tell you...          ......!uunet!utai!yunexus!oz
it is unintelligible, but hey, you      Bitnet: oz@[yulibra|yuyetti]
got it, for free (!).                   Phonet: +1 416 736-5257x3976



More information about the Comp.lang.c mailing list