mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
1.1 KiB
1.1 KiB
| layout |
|---|
| default |
Function bin #
Format a number as binary.
Syntax #
math.bin(value)
Parameters #
| Parameter | Type | Description |
|---|---|---|
value |
number | BigNumber | Value to be stringified |
wordSize |
number | BigNumber | Optional word size (see format) |
Returns #
| Type | Description |
|---|---|
| string | The formatted value |
Throws #
| Type | Description |
|---|
Examples #
//the following outputs "0b10"
math.bin(2)