intparts
v0.0.1
Published
Manipulate the integer parts of a JS Number, including frexp and ldexp.
Downloads
6
Maintainers
Readme
#intparts
Manipulate the integer parts of a JS Number, including frexp
and ldexp
.
##Author(s) Christoph Zurnieden [email protected]
##Installation
$ git clone https://github.com/czurnieden/intparts.git
$ cd intparts
$ npm install -g
There is also a Unix (or newer Macs) dependent CLI version in ./bin
.
Please be aware that this module assumes little endian.
##Version
0.0.1 Initial publication
##Description
This library implements some of the functions to inspect the innards of a 64 bit double
, the default type in ECMAScript up to version 5.1 at least. It allows direct manipulation of the bits in a Number
. Included are ports of C-lib's frexp
and ldexp
.
This module runs as ams.js where applicable.
##Usage
The usage is like with any other node/browser module:
var ip = require('intparts');
var raw_exponent = ip.getexponent(123.312); // 0x405
var unbiased_exponent = ip.frexp(123.321)[1]; // 7
This program offers ten functions which are in alphabetical order:
Return: the manipulated number
Return: the manipulated number
Return: the manipulated number
This module does no error catching.
##Example
No example yet, but ideas are welcome.