• buf.readDoubleBE()


    buf.readDoubleBE(offset[, noAssert])
    buf.readDoubleLE(offset[, noAssert])

    • offset {Number} 0 <= offset <= buf.length - 8
    • noAssert {Boolean} 默认:false
    • 返回:{Number}
    从该 Buffer 指定的带有特定尾数格式(readDoubleBE() 返回一个较大的尾数,readDoubleLE() 返回一个较小的尾数)的 offset 位置开始读取一个64位双精度值。 设置 noAssert 为 true ,将跳过对 offset 的验证。这将允许 offset 超出缓冲区的末尾。 ``` const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);

    buf.readDoubleBE();
    // Returns: 8.20788039913184e-304
    buf.readDoubleLE();
    // Returns: 5.447603722011605e-270
    buf.readDoubleLE(1);
    // throws RangeError: Index out of range

    buf.readDoubleLE(1, true); // Warning: reads passed end of buffer!
    // Segmentation fault! don't do this!

  • 相关阅读:
    c++学习记录(七)
    c++学习记录(六)
    c++学习记录(五)
    c++学习记录(四)
    2020面向对象寒假作业(二)
    2020面向对象寒假作业(二)
    HTML学习记录(一)
    我罗斯方块
    我罗斯
    面向对象程序设计3
  • 原文地址:https://www.cnblogs.com/lalalagq/p/9908640.html
Copyright © 2020-2023  润新知