Will post here too as Studio is the main app these days, I don't think people go into classic thread much. I have worked out how square root works and I believe is simply
// N#.= number we wish to square root
Function mysqrt ( N# as float )
Local X# as float
X# = N#
For loops = 1 to 100
X# = 0.5 × ( X# + ( N# / X# ) )
Next loops
Print X# + " is the square root of " + N# + " approx"
Endfunction X#
//
Just something for you guys to replace the standard sqrt function. I haven't tested it. It's from memory, but by all means give it a try and see if it comes out correctly, not sure how fast it is and maybe faster than sqrt
I have tested small ones like 64, 81 etc and comes back correct.
Trying large ones like huge numbers then will have to increase that for loop to something like 100, 1000 or do a while loop to stop when it starts repeating the result
I hope you can utilise it somewhere in our developments. It's better then the long winded sqrt. Give it a try alongside sqrt to see results but I think and tested it to be exact and faster
Aidan