R
Rustom Mody
Well, OK, I exaggerated a bit. Multiplication binds stronger than addition
in any language I've ever used, so I assume I know that one. But not much
beyond that.
Not in APL. And horners rule is one touted advantage of that
ax³ + bx² + cx + d
= d + xc + x²b + x³a
= d + x(c + xb + x²a)
= d + x(c + x(b + xa)
Now APL by precedence rules
- add and multiply are same precedence
- multiply denoted with ×
- all grouping right to left
We have last equal to
d + x×c + x×b + x×a
No, I wouldn't use either set of parens their either. But, if I have anydoubt at all, I rather than look it up, I just put parens. And my threshold for doubt is pretty low.
APL: b ≥ ¯1
ie ¯ is part of the constant and - is not ad-hoc overloaded
I wont talk of the if because that will spoil the fun
And this is a unicode experiment!