{"_id":"math-float64-ldexp","_rev":"5-98fd261352e192b675dae8caabbeb680","name":"math-float64-ldexp","description":"Multiplies a double-precision floating-point number by an integer power of two.","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.0":{"name":"math-float64-ldexp","version":"0.0.0","description":"Multiples a double-precision floating-point number by an integer power of two.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"if [ \"${TRAVIS}\" ]; then npm run test-ci; else npm run test-local; fi","test-local":"tape \"./test/*.js\" | tap-spec","test-ci":"npm run test-local && xvfb-run npm run test-browsers","test-cov":"istanbul cover --dir ./reports/coverage --report lcov tape -- \"./test/*.js\"","test-browsers":"browserify ./test/*.js | testling | tap-spec","coverage":"istanbul cover --dir ./reports/codecov/coverage --report lcovonly tape -- \"./test/*.js\" && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/math-io/float64-ldexp.git"},"keywords":["compute.io","compute-io","computation","compute","math-io","math.io","math","mathematics","frexp","ldexp","load","exponent","double","dbl","float","floating-point","number","ieee754"],"bugs":{"url":"https://github.com/math-io/float64-ldexp/issues"},"dependencies":{"const-ninf-float64":"^1.0.0","const-pinf-float64":"^1.0.0","math-float64-copysign":"^1.0.0","math-float64-exponent":"^1.0.0","math-float64-from-words":"^1.0.0","math-float64-normalize":"^1.0.0","math-float64-to-words":"^1.0.0"},"devDependencies":{"browserify":"13.x.x","codecov":"1.x.x","istanbul":"^0.4.1","jshint":"2.x.x","jshint-stylish":"2.x.x","math-float64-frexp":"^1.0.0","math-power":"^1.0.0","math-round":"^1.0.0","tap-spec":"4.x.x","tape":"4.x.x","testling":"1.x.x"},"testling":{"files":["test/*.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..latest","firefox/nightly","chrome/4.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"license":"MIT","gitHead":"d572c98a94240d2ca778be926becdab9f9e0759b","homepage":"https://github.com/math-io/float64-ldexp#readme","_id":"math-float64-ldexp@0.0.0","_shasum":"9d8b7720ebc847ec29f203d10c5f5ece2b723d72","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"9d8b7720ebc847ec29f203d10c5f5ece2b723d72","tarball":"https://registry.npmjs.org/math-float64-ldexp/-/math-float64-ldexp-0.0.0.tgz","integrity":"sha512-eyHUaDe9dz4bebAc9MCRBxDmZoC/fodeyIjfPjny8GzreqGPO7RK3oWuV2MP99M8lEJRZjDDyPbTzuq1MRCfgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHSlFm0PP+RgD+ViI9os8hKuxUfl76u8S1UPIwGDJOapAiEAuS5RYLvP8T4xthAi2YJaAjK9A/pmgL7sdKxFi8SW6cc="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/math-float64-ldexp-0.0.0.tgz_1456000870889_0.2841225625015795"}},"1.0.0":{"name":"math-float64-ldexp","version":"1.0.0","description":"Multiples a double-precision floating-point number by an integer power of two.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"if [ \"${TRAVIS}\" ]; then npm run test-ci; else npm run test-local; fi","test-local":"tape \"./test/*.js\" | tap-spec","test-ci":"npm run test-local && xvfb-run npm run test-browsers","test-cov":"istanbul cover --dir ./reports/coverage --report lcov tape -- \"./test/*.js\"","test-browsers":"browserify ./test/*.js | testling | tap-spec","coverage":"istanbul cover --dir ./reports/codecov/coverage --report lcovonly tape -- \"./test/*.js\" && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/math-io/float64-ldexp.git"},"keywords":["compute.io","compute-io","computation","compute","math-io","math.io","math","mathematics","frexp","ldexp","load","exponent","double","dbl","float","floating-point","number","ieee754"],"bugs":{"url":"https://github.com/math-io/float64-ldexp/issues"},"dependencies":{"const-ninf-float64":"^1.0.0","const-pinf-float64":"^1.0.0","math-float64-copysign":"^1.0.0","math-float64-exponent":"^1.0.0","math-float64-from-words":"^1.0.0","math-float64-normalize":"^1.0.0","math-float64-to-words":"^1.0.0"},"devDependencies":{"browserify":"13.x.x","codecov":"1.x.x","istanbul":"^0.4.1","jshint":"2.x.x","jshint-stylish":"2.x.x","math-float64-frexp":"^1.0.0","math-power":"^1.0.0","math-round":"^1.0.0","tap-spec":"4.x.x","tape":"4.x.x","testling":"1.x.x"},"testling":{"files":["test/*.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..latest","firefox/nightly","chrome/4.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"license":"MIT","gitHead":"4d2fddad61a79c40f1421f37a5e2f0f4088fa37f","homepage":"https://github.com/math-io/float64-ldexp#readme","_id":"math-float64-ldexp@1.0.0","_shasum":"d92777b442c19605b6a6795c6e1c31a99eb6ce75","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"d92777b442c19605b6a6795c6e1c31a99eb6ce75","tarball":"https://registry.npmjs.org/math-float64-ldexp/-/math-float64-ldexp-1.0.0.tgz","integrity":"sha512-ynD9Ve4bSlLRBSDKrg8zoTf2v5MDSTKGTtfsZlsa1/2UKrjNFfG1GCv35TYGSGpdRpzOO1MnXL2ho9bcVLISmg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfJqhSjIiuplYPrYrs9SegUXKbKlP23Wbj37hskppdrAiEA15XezpzYDyPU6Ia34Lda71gBdi2VpsOdhhfG8UH/vvI="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/math-float64-ldexp-1.0.0.tgz_1456000888294_0.7548612670507282"}},"1.0.1":{"name":"math-float64-ldexp","version":"1.0.1","description":"Multiplies a double-precision floating-point number by an integer power of two.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"if [ \"${TRAVIS}\" ]; then npm run test-ci; else npm run test-local; fi","test-local":"tape \"./test/*.js\" | tap-spec","test-ci":"npm run test-local && xvfb-run npm run test-browsers","test-cov":"istanbul cover --dir ./reports/coverage --report lcov tape -- \"./test/*.js\"","test-browsers":"browserify ./test/*.js | testling | tap-spec","coverage":"istanbul cover --dir ./reports/codecov/coverage --report lcovonly tape -- \"./test/*.js\" && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/math-io/float64-ldexp.git"},"keywords":["compute.io","compute-io","computation","compute","math-io","math.io","math","mathematics","frexp","ldexp","load","exponent","double","dbl","float","floating-point","number","ieee754"],"bugs":{"url":"https://github.com/math-io/float64-ldexp/issues"},"dependencies":{"const-ninf-float64":"^1.0.0","const-pinf-float64":"^1.0.0","math-float64-copysign":"^1.0.0","math-float64-exponent":"^1.0.0","math-float64-from-words":"^1.0.0","math-float64-normalize":"^1.0.0","math-float64-to-words":"^1.0.0"},"devDependencies":{"browserify":"13.x.x","codecov":"1.x.x","istanbul":"^0.4.1","jshint":"2.x.x","jshint-stylish":"2.x.x","math-float64-frexp":"^1.0.0","math-power":"^1.0.0","math-round":"^1.0.0","tap-spec":"4.x.x","tape":"4.x.x","testling":"1.x.x"},"testling":{"files":["test/*.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..latest","firefox/nightly","chrome/4.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"license":"MIT","gitHead":"84939c2b15f7fc97121ea34200983d9540347615","homepage":"https://github.com/math-io/float64-ldexp#readme","_id":"math-float64-ldexp@1.0.1","_shasum":"e8076daa29a6529a572002fa9fd9e3e3c52253da","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"e8076daa29a6529a572002fa9fd9e3e3c52253da","tarball":"https://registry.npmjs.org/math-float64-ldexp/-/math-float64-ldexp-1.0.1.tgz","integrity":"sha512-U6QZ56z/c/UE1R/TMD8iFoh8OCB0rDzCwriGlQp73sVpWKB2lkxOTmRlUDbAXIsTcUZ/nKEzNRyEepk2xVh38Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnD4qjTTgugcdQvyw1YikOEJIJ5NqqVJcT3aBQz4vkCAIgXsZ8Y6MG9pffa6BRxlPWVgLSLjXkSbYEm//MEUhLmkQ="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/math-float64-ldexp-1.0.1.tgz_1463529990219_0.2414454568643123"}}},"readme":"ldexp\n===\n[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]\n\n> Multiplies a [double-precision floating-point number][ieee754] by an integer power of two.\n\n\n## Installation\n\n``` bash\n$ npm install math-float64-ldexp\n```\n\n\n## Usage\n\n``` javascript\nvar ldexp = require( 'math-float64-ldexp' );\n```\n\n#### ldexp( frac, exp )\n\nMultiplies a [double-precision floating-point number][ieee754] by an `integer` power of two; i.e., `x = frac * 2**exp`.\n\n``` javascript\nvar x = ldexp( 0.5, 3 ); // => 0.5 * 2**3 = 0.5 * 8\n// returns 4\n\nx = ldexp( 4, -2 ); // => 4 * 2**(-2) = 4 * (1/4)\n// returns 1\n```\n\nIf `frac` equals positive or negative `zero`, `NaN`, or positive or negative `infinity`, the `function` returns a value equal to `frac`.\n\n``` javascript\nvar x = ldexp( 0, 20 );\n// returns 0\n\nx = ldexp( -0, 39 );\n// returns -0\n\nx = ldexp( NaN, -101 );\n// returns NaN\n\nx = ldexp( Number.POSITIVE_INFINITY, 11 );\n// returns +infinity\n\nx = ldexp( Number.NEGATIVE_INFINITY, -118 );\n// returns -infinity\n```\n\n\n## Notes\n\n*\tThis `function` is the inverse of [`frexp`][math-float64-frexp].\n\n\n## Examples\n\n``` javascript\nvar round = require( 'math-round' );\nvar pow = require( 'math-power' );\nvar frexp = require( 'math-float64-frexp' );\nvar ldexp = require( 'math-float64-ldexp' );\n\nvar sign;\nvar frac;\nvar exp;\nvar x;\nvar f;\nvar v;\nvar i;\n\n/**\n* 1) Generate random numbers.\n* 2) Break each number into a normalized fraction and an integer power of two.\n* 3) Reconstitute the original number.\n*/\nfor ( i = 0; i < 100; i++ ) {\n\tif ( Math.random() < 0.5 ) {\n\t\tsign = -1;\n\t} else {\n\t\tsign = 1;\n\t}\n\tfrac = Math.random() * 10;\n\texp = round( Math.random()*616 ) - 308;\n\tx = sign * frac * pow( 10, exp );\n\tf = frexp( x );\n\tv = ldexp( f[ 0 ], f[ 1 ] );\n\tconsole.log( '%d = %d * 2^%d = %d', x, f[ 0 ], f[ 1 ], v );\n}\n```\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n---\n## Tests\n\n### Unit\n\nThis repository uses [tape][tape] for unit tests. To run the tests, execute the following command in the top-level application directory:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis repository uses [Istanbul][istanbul] as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n### Browser Support\n\nThis repository uses [Testling][testling] for browser testing. To run the tests in a (headless) local web browser, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-browsers\n```\n\nTo view the tests in a local web browser,\n\n``` bash\n$ make view-browser-tests\n```\n\n<!-- [![browser support][browsers-image]][browsers-url] -->\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n\n## Copyright\n\nCopyright &copy; 2016. The [Compute.io][compute-io] Authors.\n\n\n[npm-image]: http://img.shields.io/npm/v/math-float64-ldexp.svg\n[npm-url]: https://npmjs.org/package/math-float64-ldexp\n\n[build-image]: http://img.shields.io/travis/math-io/float64-ldexp/master.svg\n[build-url]: https://travis-ci.org/math-io/float64-ldexp\n\n[coverage-image]: https://img.shields.io/codecov/c/github/math-io/float64-ldexp/master.svg\n[coverage-url]: https://codecov.io/github/math-io/float64-ldexp?branch=master\n\n[dependencies-image]: http://img.shields.io/david/math-io/float64-ldexp.svg\n[dependencies-url]: https://david-dm.org/math-io/float64-ldexp\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/math-io/float64-ldexp.svg\n[dev-dependencies-url]: https://david-dm.org/dev/math-io/float64-ldexp\n\n[github-issues-image]: http://img.shields.io/github/issues/math-io/float64-ldexp.svg\n[github-issues-url]: https://github.com/math-io/float64-ldexp/issues\n\n[tape]: https://github.com/substack/tape\n[istanbul]: https://github.com/gotwarlost/istanbul\n[testling]: https://ci.testling.com\n\n[compute-io]: https://github.com/compute-io/\n[ieee754]: https://en.wikipedia.org/wiki/IEEE_754-1985\n[math-float64-frexp]: https://github.com/math-io/float64-frexp\n","maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"time":{"modified":"2022-06-19T16:39:04.999Z","created":"2016-02-20T20:41:13.625Z","0.0.0":"2016-02-20T20:41:13.625Z","1.0.0":"2016-02-20T20:41:32.203Z","1.0.1":"2016-05-18T00:06:30.810Z"},"homepage":"https://github.com/math-io/float64-ldexp#readme","keywords":["compute.io","compute-io","computation","compute","math-io","math.io","math","mathematics","frexp","ldexp","load","exponent","double","dbl","float","floating-point","number","ieee754"],"repository":{"type":"git","url":"git://github.com/math-io/float64-ldexp.git"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"bugs":{"url":"https://github.com/math-io/float64-ldexp/issues"},"license":"MIT","readmeFilename":"README.md"}