double-to-base-2-string
Version:
Turn a number into a human readable binary string
35 lines (23 loc) • 615 B
Markdown
double-to-base-2-string
=======================
Prints out a binary representation of the bits of a floating point number.
```javascript
var b2str = require("double-to-base-2-string")
console.log(b2str(0.3))
```
Output:
```javascript
1.00110011001100110011110011001100110011001100110011*2^-2
```
```
npm install double-to-base-2-string
```
Converts a number into a radix 2 binary expansion.
* `n` is a double precision number
**Returns** A binary fractional number which represents `n`
(c) 2014 Mikola Lysenko. MIT License