While not semantically equivalent with JS semantics, this appears to be the right thing to do in AS. Also avoids using changetype just for this purpose, which will eventually become considered unsafe.
Remaining implementations of JavaScript's Math functions (except sin/cos/tan), both double (Math) and single (Mathf) precision, ported from musl incl. tests from libc-test, plus some changes to match JS semantics. Also binds fmod to `%` and pow to `**`.
When calling indirectly, the number of required operands might not be known at compile time and providing the actual number of operands instead solves this.