1. Re: Math Shortcuts
- Posted by Robert McDougal <thedoog at MAILEXCITE.COM> Jul 03, 1998
- 448 views
- Last edited Jul 04, 1998
Hi - It might be faster if you had the computer find the square root of a number by implementing an algorithim which would use the long-hand method of square roots. That way no time would be wasted calculating to unnecessary precision. Of course, try replacing raising a value to a power with simply multiplying it by itself. In my BASIC-09 manual (just to give an example), it says that multiplying reals took about 990 clock cycles, while raising a real to a number took 39,200 cycles! Of course Euphoria isn't basic and it's running on a much better system, but I stil imagine that would speed things up slightly. Side note here -- I think it would be great if such a table existed for Euphoria. Does anyone know of such a thing? Also, you realize if delta X and delta Y are equal than the distance is simply sqrt(2)*(x2-x1). <-- 2D dist. equ. It's quite possible that you have already implemented these things, but beyond things like these which (may) speed up the code. If you have already done these, sorry for wasting your time, if not, I hope this has helped. If you get any better suggestions, I'm curious to find out how. Hope I was of some service, - Robert McDougal Free web-based email, Forever, From anywhere! http://www.mailexcite.com