mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
23 lines (22 loc) • 415 B
JavaScript
import { createBaseFormatterFactory } from './baseUtils.js';
/**
* Format a number as binary.
*
* Syntax:
*
* math.bin(value)
*
* Examples:
*
* //the following outputs "0b10"
* math.bin(2)
*
* See also:
*
* oct
* hex
*
* @param {number} value Value to be stringified
* @return {string} The formatted value
*/
export var createBin = createBaseFormatterFactory('bin', 2);