Nothing Particularly Magnificent
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

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

1

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability