Yes, isn't it great ;) As I mentioned before, this was developped to solve a specific problem and the application happened to supply a signed integer. Or to put it an other way: i've been lazy.
Just checked my notes regarding the preset values. They are chosen to calculate the square root of any number between 0 and 2^32 (yes, unsigned) in 4 itterations. 0 itself should be handled separately (resolves to 1, more itterations will give 0 but the next itteration will divde by zero). I have verified this with a spreadsheet but did not verify the implementation itself. A known issue is that rounding can be off (7 is 2.65^2 but will become 2, regardless of the number of itterations added). Joep 2009/10/24 Rob Hamerling <[email protected]> > > > Hi Joep, > > [email protected] wrote: > > > Log: For Rob, a preliminary version of integer-based sqrt > > Thanks! > > > +function sqrt(sdword in invalue) return sword is > > Uhhhm ... 'signed' variables for square root??? > My math may be rusty, but this would imply complex numbers... > > Regards, Rob. > > -- > Rob Hamerling, Vianen, NL (http://www.robh.nl/) > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
