base-conversion-to-dec
Auto-curried converter from any base with arbitrary precision support and customisable symbols.
For the opposite behaviour, see base-conversion-from-dec. For any to any base conversions, see base-conversion.
Install
npm i base-conversion-to-dec
Basic usage
var bc = ;var hexToBin = ; ; //=> '1010'; //=> '11110'
See spec.
Fractional support (including bases)
; //=> '10.098765432098766'
See in wolfram|Alpha.
; //=> '9.992126756390263'
See in wolfram|Alpha.
Custom symbols
For any bases above 62, custom symbols are required. See tests for working examples.
bc; //=> '⑦③'
Arbitrary precision
var Big = ;var toBigFactory = ; var d = ; // avoid large numbers to go into exponential notation (adapter dependent)BigImplE_POS = 50; bc;//=> '5678364565345634563456346757364563534534645745'
Full raw version
var Big = ;var toBigFactory = ; var d = ; // avoid large numbers to go into exponential notation (adapter dependent)BigImplE_POS = 50; bc;//=> '#678364#6#34#634#634#63467#7364#63#34#3464#74#'
Defaults
The default symbols and big implementation are exposed as follows:
bcdefaultSymbols; //=> '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'bcdefaultB; //=> default arbitrary precision implementation (plus, times & pow)