1.0.2 • Published 9 years ago

least-significant-trit v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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