Javascript DataView getFloat32()

Introduction

The Javascript DataView getFloat32() method gets a signed 32-bit float at the specified byte offset from the DataView.

dataview.getFloat32(byteOffset [, littleEndian])
  • byteOffset - the offset in byte from the start of the view.
  • littleEndian - Optional, indicates whether the 32-bit float is stored in little- or big-endian format. If false or undefined, a big-endian value is read.

It returns a signed 32-bit float number.

Using the getFloat32 method

var buffer = new ArrayBuffer(8);
var dataview = new DataView(buffer);
let a = dataview.getFloat32(1); 
console.log(a);/*  ww  w  . ja v a  2  s .co m*/



PreviousNext

Related