$ npm install ecma-proposal-math-extensionsMath Extensions ProposalRick Waldron
This proposal is currently stage 1 of the TC39 process.
These functions exist in many, many JS libraries either hand rolled or via many modules on npm. Providing them as built-ins serves to pave cow path. Implementations and naming is inconsistent. Several other languages offer these as built-ins.
Java
Math
Math.toDegrees(double angrad)Math.toRadians(double angdeg)Python
math
math.degrees(x)math.radians(x)Racket
Rust
Math.map
Math.scale <-- thisMath.mapMath.remapMath.fmap? (ie. https://tc39.github.io/ecma262/#sec-math.fround, Step 3 & 4 convert result to IEEE 754-2008 binary32 (using roundTiesToEven), then to IEEE 754-2008 binary64).Math.constrain
Math.constrainMath.clamp