npm.nicfv.com

    Module smath - v1.13.1

    Small math function library

    NPM Downloads NPM Last Update

    Small math? Simple math? Or supplemental math? Canonically, "SMath" is pronounced "smath" and stands for "small math (library.)" Similar to JavaScript's builtin Math object, SMath exports one global object with several math-related helper functions. There is no need to instantiate the class, just call functions directly. See the examples below to get started using SMath!

    SMath is also packaged with an executabe that can be run directly through npx in the terminal - even outside of a NodeJS project! In fact, open your terminal now, and type the following to show a list of valid npx smath commands!

    npx smath help
    

    Commands are all structured like this.

    npx smath [cmd] [args]
    

    This example command returns the value 0.4.

    npx smath normalize 4 0 10
    

    Most SMath functions are available through npx, except for calculus functions which require a functional argument.

    Documents

    CHANGELOG
    Examples/Deck Shuffler
    Examples/JavaScript Math Oddities
    Examples/Tangent Line
    Examples/Temperature Conversion

    Functions

    approx
    avg
    clamp
    differentiate
    error
    expand
    factorial
    factors
    integrate
    lim
    linspace
    logspace
    median
    mixed
    normalize
    prod
    rat
    rdist
    rint
    rnorm
    round2
    runif
    shuffle
    stdevp
    stdevs
    sum
    toHex
    translate
    varp
    vars
    MMNEPVFCICPMFPCPTTAAATR