What functions are you missing? What would be convenient, or possibly faster, with a built in function?
We’ve recently discussed a few that I’ll start with:
sqrt(x*x + y*y)
hypot3(x, y, z)-
sqrt(x*x + y*y + z*z)
trunc(n)- removes fractional components for positive or negative numbers. e.g.
trunc(5.5) == 5,
trunc(-5.5) == -5. (Note: I’d use
whole()but JS and C use
frac(n)- just the fractional component, like
n % 1. e.g.
frac(5.5) == .5
frac(-5.5) == -.5So that
trunc(n) + frac(n) == nfor positive and negative numbers.
I have a huge list in addition to this but I’m curious what you have in mind!