Utilities for decomposing doubles (Number) and pretty printing
var doubleUtils = require('double-utils')
console.log(doubleUtils.sign(Math.PI))
console.log(doubleUtils.exp(Math.PI))
console.log(doubleUtils.frac(Math.PI))
// OR
console.log(doubleUtils.decompose(Math.PI))
console.log(doubleUtils.format(Math.PI))
Returns the sign bit. 0
is positive, 1
is negative
Returns the exponent part, which is a number between [0, 2048)
Returns the fractional (or mantissa) part, which is a 52-bit number
Run the above three methods at once
Print the number as a bit string, with an optional guide.
npm install double-utils