Thank you, it works and is about 16 times faster :)
Joep

2009/10/29 zmafoo <[email protected]>

>
> Greetings,
>
> Here's an easy/quick sqrt function if there's still interest. Simply
> change the initial m value for sqrt8 or sqrt32:
>
> function sqrt16(word in n) return byte is
>  var word m, y
>
>  m = 0x4000
>  y = 0
>  while (m) loop
>    var word b
>
>    b = y | m
>    y = y >> 1
>    if (x >= b) then
>      x = x - b
>      y = y | m
>    end if
>    m = m >> 2
>  end loop
>  return y
> end function
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to