buf.readFloatLE(offset[, noAssert])
Reads a 32-bit float from the Buffer at the specified offset
with specified endian format (readFloatBE()
returns big endian, readFloatLE()
returns little endian).
Setting noAssert
to true
skips validation of the offset
. This allows the offset
to be beyond the end of the Buffer.
const buf = Buffer.from([1,2,3,4]); buf.readFloatBE(); // Returns: 2.387939260590663e-38 buf.readFloatLE(); // Returns: 1.539989614439558e-36 buf.readFloatLE(1); // throws RangeError: Index out of range buf.readFloatLE(1, true); // Warning: reads passed end of buffer! // Segmentation fault! don't do this!
Please login to continue.