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

Dependents (1)

Package Sidebar

Install

npm i least-significant-trit

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • thirdcoder