The math functions I'd like to propose be added to the DM language are the following:
tan(x):
tangeant; much faster to call it natively than to call "sin(x) / cos(x)" in softcode
proc/tan(var/V)
. = sin(V) / cos(V)
sign(x):
sign(x) would return the sign of X, either -1, 0, or 1. In the case of -1.#INF or 1.#INF, would return -1/1 respectively, but for any .#INV value, would return .#INV.
proc/sign(x)
. = x ? x / abs(x) : 0
fix(x):
fix(x) is a bit like round(x), but in the event of a negative number, rounds towards 0 instead of away from it. e.g. fix(1.2) = 1, fix(-3.4) = -3. round(-3.4) = -4, according to the DM help file.
proc/fix(x)
. = x ? round(abs(x)) * sign(x) : 0