DataView.prototype.setFloat64()
The setFloat64()
method stores a signed 64-bit float
(double) value at the specified byte offset from the start of the
DataView
.
Syntax
setFloat64(byteOffset, value)
setFloat64(byteOffset, value, littleEndian)
Parameters
byteOffset
-
The offset, in byte, from the start of the view where to store the data.
value
-
The value to set.
littleEndian
-
Optional Indicates whether the 64-bit float is stored in little- or big-endian format. If
false
orundefined
, a big-endian value is written.
Return value
Errors thrown
RangeError
-
Thrown if the
byteOffset
is set such as it would store beyond the end of the view.
Examples
Using the setFloat64 method
var buffer = new ArrayBuffer(8);
var dataview = new DataView(buffer);
dataview.setFloat64(0, 3);
dataview.getFloat64(0); // 3
Specifications
Specification |
---|
ECMAScript Language Specification # sec-dataview.prototype.setfloat64 |
Browser compatibility
BCD tables only load in the browser