positional-notation
Calculate the decimal equivalent given a base, a position and a decimal value
Install
npm i positional-notation
Basic usage
var fn = ; ; //=> 1920; //=> 1875
Arbitrary precision
var Decimal = ;Decimal; var d = Decimal; fn; // d(30)
where d
is a toDecimal
with at least times
and pow
.
Use case: functional hex to dec
const R = ;const fn = ; const symbols = '0': '0' '1': '1' '2': '2' '3': '3' '4': '4' '5': '5' '6': '6' '7': '7' '8': '8' '9': '9' 'A': '10' 'B': '11' 'C': '12' 'D': '13' 'E': '14' 'F': '15'; const posNotation = ; const hexToDec = R; ; //=> 2016
See spec.