Wondering what’s next for npm?Check out our public roadmap! »

    least-significant-trit

    1.0.2 • Public • Published

    lst

    Get the "least significant trit" (LST) of a number

    Usage:

    var lst = require('least-significant-trit');
    
    lst(3);     // 0
    lst(4);     // 1
    lst(5);     // -1
    
    lst(-3);    // 0
    lst(-4);    // -1
    lst(-5)     // 1
    

    The LST is the rightmost digit when the signed integer is written in balanced ternary notation. Similar to least significant bit (LSB) in base 2 except for base 3.

    See also: balanced-ternary

    Install

    npm i least-significant-trit

    DownloadsWeekly Downloads

    0

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • avatar