Protect your apps from supply chain attacksInstall
Encoding floating-point numbers
const ieee754 = require('@xtuc/ieee754'); let buffer = new ArrayBuffer(8); let view = new DataView(buffer); ieee754.write(view, 123.456, 0, false, 52, 8);
Decoding floating-point numbers
const ieee754 = require('@xtuc/ieee754'); let buffer = new ArrayBuffer(8); let view = new DataView(buffer); view.setFloat64(0, 123.456, false); let number = ieee754.read(view, 0, false, 52, 8);
npm install ieee754
var ieee754 = require('ieee754')
ieee754 object has the following functions:
ieee754.read = function (buffer, offset, isLE, mLen, nBytes) ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes)
The arguments mean the following:
The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point computation. Read more.
BSD 3 Clause. Copyright (c) 2008, Fair Oaks Labs, Inc.
Read/write IEEE754 floating point numbers from/to a Buffer or array-like object
The npm package @xtuc/ieee754 receives a total of 16,485,014 weekly downloads. As such, @xtuc/ieee754 popularity was classified as popular.
We found that @xtuc/ieee754 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.