least-significant-trit
v1.0.2
Published
get least significant trit of a signed integer
Downloads
13
Maintainers
Readme
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