A few notes on extremely tiny optimization:
I've actually found in my ProcLib tests that sign is (oddly enough) faster this way:
> proc/sign(n) return n && n / abs(n)
>
rather than using a ternary operator or a series of conditionals.That is odd indeed. I wrote two different versions, and they're both faster than your version by about %10-15. Oddly enough(heh), it uses ternary operators as well.
sign_1(x) return (x < 0) ? -1 : (x > 0)
sign_2(x) return (x > 0) - (x < 0)
I guess DM's compiler is rather crappy at optimizing code.
EDIT: In newer versions, yours might(I haven't tested it yet) actually be faster since Lummox JR optimized abs() along with some other math functions.
That should return 180