
from the fascinating bithacks book Hackers Delight i've no doubt several ppl here also already have

Code: Select all
EnableExplicit
Procedure ISqr(x) ;Square Root
Protected m,b,y,t
m = $40000000
While m
b = y | m
y >> 1
t = (x | ~(x - b)) >> 31
x = x - (b & t)
y = y | (m & t)
m = m >> 2
Wend
ProcedureReturn y
EndProcedure
Procedure IExp(x,n) ;Exponentiation
Protected p=x,y=1
Repeat
If (n & 1): y = p * y: EndIf
n>>1
If Not n: ProcedureReturn y: EndIf
p*p
ForEver
EndProcedure
Procedure ICbRt(x) ;Cubic Root
Protected s,y,b
For s = 30 To 0 Step -3
y*2
b = (3*y*(y+1)+1) << s
If x => b
x-b
y+1
EndIf
Next s
ProcedureReturn y
EndProcedure