Nimble Porridge Muncher

    ecma-proposal-math-extensions
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/ecma-proposal-math-extensions package

    0.0.2 • Public • Published

    Math Extensions Proposal

    Champion

    Rick Waldron

    Status

    This proposal is currently stage 1 of the TC39 process.

    Motivation

    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

    Python

    Racket

    Rust

    Questions

    • Math.map
      • Is it...
        • Math.scale <-- this
        • Math.map
        • Math.remap
      • Should there be a corresponding Math.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
      • Is it...
        • Math.constrain
        • Math.clamp

    Install

    npm i ecma-proposal-math-extensions

    DownloadsWeekly Downloads

    168

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • rwaldron