# TO THE NTH POWER

Robbie Matthews robbie.matthews at f1701.n7802.fido.oz.au
Fri Nov 16 09:29:24 AEST 1990


Original to: blambert at lotus.com
OK. Here is a way of getting an integer root that I haven't seen yet:
 
 for (sqrtx=1, j=1, k=1; j<x; sqrtx+=1, k+=2, j+=k );
 
Try it and see. Only works for positive integers, but as there is no
multiplication or division, works reasonably fast. Especially on a 8 bit
machine.
 Not claiming it's a _better_ way... it's just a way.

--- TMail v1.19
 * Origin: Prophet BBS (8:7802/1701)



More information about the Comp.lang.c mailing list