Javascript DataView setFloat64()

Introduction

The Javascript DataView setFloat64() method stores a signed 64-bit float value at the specified offset to the DataView.

dataview.setFloat64(byteOffset, value [, littleEndian])
  • byteOffset - the offset, in byte, from the start of the view.
  • value - the value to set.
  • littleEndian - Optional, boolean value. If false or undefined, a big-endian value is written. Otherwise use the little endian.

Using the setFloat64 method

var buffer = new ArrayBuffer(8);
var dataview = new DataView(buffer);
dataview.setFloat64(0, 3);/* w ww  .j ava  2 s.co m*/
let a = dataview.getFloat64(0);
console.log(a); // 3



PreviousNext

Related