{"_id":"double-bits","_rev":"8-8abece0918d58fc705cde7ba405f4412","name":"double-bits","description":"Inspect binary representation of IEEE754 doubles","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"double-bits","version":"1.0.0","description":"Inspect binary representation of IEEE754 doubles","main":"double.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"pad":"0.0.4","tape":"^2.12.3"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/double-bits.git"},"keywords":["double","bits","exponent","fraction","sign","binary","word"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/double-bits/issues"},"homepage":"https://github.com/mikolalysenko/double-bits","_id":"double-bits@1.0.0","dist":{"shasum":"82b8cca7689d986088e71713c100851fc313efea","tarball":"https://registry.npmjs.org/double-bits/-/double-bits-1.0.0.tgz","integrity":"sha512-JlJPj69PJvfa7J4gDwloXCvWahP/cbPq5SYr0A/NdZ+JzuwavC96wP6GBRAAiZDzK/y6T2e7B9lhzE6Qu5nCQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFLcUgTFILvcEKOfJPs2sKsQm2u8Ji1thMCCuML8/d6cAiBkYYvyW0nqOkbtbqJPnlDAwj5kcPUfcjS+Mk2YOHvUTw=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]},"1.1.0":{"name":"double-bits","version":"1.1.0","description":"Inspect binary representation of IEEE754 doubles","main":"double.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"pad":"0.0.4","tape":"^2.12.3"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/double-bits.git"},"keywords":["double","bits","exponent","fraction","sign","binary","word"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/double-bits/issues"},"homepage":"https://github.com/mikolalysenko/double-bits","_id":"double-bits@1.1.0","dist":{"shasum":"87ea00aa6cbabbe40472a972f8e2becfd3ed4df7","tarball":"https://registry.npmjs.org/double-bits/-/double-bits-1.1.0.tgz","integrity":"sha512-8mu7EWUYk4IcgNd4afX05EMlpumMQudNMN/e/RK90q+j4R51HNx4GE5b4L4Pu/dd/hDERhNtKqdkA2BG69IWWg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFvk6ZUrSYUUoglNx3NLL9RUld9mawytb3EcDKeUY7IAAiBKh+jv0RVjrBwpZgu+13/JjJy4yeQmWjucwnTGiyGu4A=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]},"1.1.1":{"name":"double-bits","version":"1.1.1","description":"Inspect binary representation of IEEE754 doubles","main":"double.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"pad":"0.0.4","tape":"^2.12.3"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/double-bits.git"},"keywords":["double","bits","exponent","fraction","sign","binary","word"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/double-bits/issues"},"homepage":"https://github.com/mikolalysenko/double-bits","testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"_id":"double-bits@1.1.1","dist":{"shasum":"58abba45494da4d0fa36b73ad11a286c9184b1c6","tarball":"https://registry.npmjs.org/double-bits/-/double-bits-1.1.1.tgz","integrity":"sha512-BCLEIBq0O/DWoA7BsCu/R+RP0ZXiowP8BhtJT3qeuuQEBpnS8LK/Wo6UTJQv6v8mK1fj8n90YziHLwGdM5whSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrcLs2Na/ty2eHCqde2H1RW/v6pcgu60ued1gYUqr/SwIgALsuPtuQU3K0dAnplsfJ3s55cEgprae8GbTlKVi+H70="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]}},"readme":"double-bits\n===========\nRoutines for manipulating binary representations of a IEEE 754 double precision numbers.\n\n[![testling badge](https://ci.testling.com/mikolalysenko/double-bits.png)](https://ci.testling.com/mikolalysenko/double-bits)\n\n[![build status](https://secure.travis-ci.org/mikolalysenko/double-bits.png)](http://travis-ci.org/mikolalysenko/double-bits)\n\n## Example\n\n```javascript\nvar db = require(\"double-bits\")\n\n//Get higher order word\nconsole.log(db.hi(1.0).toString(16))    //Prints out: 3ff00000\n\n//Get lower order word\nconsole.log(db.lo(1.0).toString(16))    //Prints out: 0\n\n//Combine two words into a double\nconsole.log(db.pack(0, 0x3ff00000))     //Prints out: 1.0\n\n//More sophisticated example:  Print out base 2 representation\nvar pad = require(\"pad\")\nfunction base2Str(n) {\n  var f = db.fraction(n)\n  return (db.sign(n) ? \"-\" : \"\") +\n    \"2^\" + (db.exponent(n)+1) +\n    \" * 0.\" + pad(f[1].toString(2), 20, \"0\") + \n              pad(f[0].toString(2), 32, \"0\")\n}\nconsole.log(base2Str(1.0))\n//Prints out:\n//\n//   2^1 * 0.10000000000000000000000000000000000000000000000000000\n//\n```\n\n## Install\n\n```\nnpm install double-bits\n```\n\n## API\n\n```javascript\nvar db = require(\"double-bits\")\n```\n\n### `db(n)`\nReturns a pair of 32-bit unsigned ints encoding the lower/higher order words respectively representing `n`\n\n* `n` is an IEEE754 double number\n\n**Returns** An array, `[lo,hi]` encoding `n`\n\n### `db.lo(n)`\nReturns the lower order word of `n`\n\n* `n` is an IEEE754 number\n\n**Returns** The lower order word of `n`\n\n### `db.hi(n)`\nReturns the higher order word of `n`\n\n* `n` is an IEEE754 number\n\n**Returns** The higher order word of `n`\n\n### `db.pack(lo, hi)`\nGiven a pair of lower/higher order words, concatenate them into a 64 bit double precision number\n\n* `lo` is the lower order word\n* `hi` is the higher order word\n\n**Returns** An IEEE754 double precision number formed by concatenating the bits of `lo` and `hi`\n\n### `db.sign(n)`\nReturns the state of the sign bit of `n`\n\n* `n` is an IEEE754 double precision number\n\n**Returns** The sign bit of `n`\n\n### `db.exponent(n)`\nReturns the exponent of `n`\n\n* `n` is an IEEE754 double precision number\n\n**Returns** The exponent of `n`\n\n### `db.fraction(n)`\nReturns the fractional part of `n`\n\n* `n` is an IEEE754 double precision number\n\n**Returns** The fractional part of `n` encoded as a pair of numbers, `[lo,hi]` where `lo` is a 32 bit integer and `hi` is a 21 bit integer.\n\n### `db.denormalized(n)`\nTest if a double is [denormalized](http://en.wikipedia.org/wiki/Denormal_number).\n\n* `n` is a number\n\n**Returns** `true` if `n` is denormal, `false` otherwise\n\n## Credits\n(c) 2014 Mikola Lysenko. BSD License","maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"time":{"modified":"2022-06-15T22:46:34.241Z","created":"2014-04-28T17:11:14.503Z","1.0.0":"2014-04-28T17:11:14.503Z","1.1.0":"2014-05-01T13:13:27.642Z","1.1.1":"2014-06-12T23:06:54.785Z"},"homepage":"https://github.com/mikolalysenko/double-bits","keywords":["double","bits","exponent","fraction","sign","binary","word"],"repository":{"type":"git","url":"git://github.com/mikolalysenko/double-bits.git"},"author":{"name":"Mikola Lysenko"},"bugs":{"url":"https://github.com/mikolalysenko/double-bits/issues"},"license":"MIT","readmeFilename":"README.md"}