Quote:
|
Originally Posted by Anton
I've got a little problem: as a part of the joystick program i need to use Pitagoras'es formula, which means square root...
|
What do you need to do with the result? If you're just comparing it to something, you can instead compare to the square of that something and avoid taking the square root altogether.
If the result is going to be used as an integer, you can use a much smaller lookup table. Since many inputs will yield the same output, you can actually make a table of squares and search through it (using a binary search will keep it short).