UNPKG

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

40 lines (24 loc) 579 B
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> # Function bin Format a number as binary. ## Syntax ```js math.bin(value) ``` ### Parameters Parameter | Type | Description --------- | ---- | ----------- `value` | number | Value to be stringified `wordSize` | number | Optional word size (see `format`) ### Returns Type | Description ---- | ----------- string | The formatted value ## Examples ```js //the following outputs "0b10" math.bin(2) ``` ## See also [oct](oct.md), [hex](hex.md)