| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat16 | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
Since 2025 4, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
DataView setFloat16() DataView 2 16 . , .
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);
const view = new DataView(buffer);
view.setFloat16(1, Math.PI);
console.log(view.getFloat16(1));
// Expected output: 3.140625
setFloat16(byteOffset, value)
setFloat16(byteOffset, value, littleEndian)
RangeErrorbyteOffset .
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setFloat16(0, 3);
dataview.getFloat16(1); // 0
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-dataview.prototype.setfloat16 |
This page was last modified on 2025 2 11 by MDN contributors.
DataViewDataView.prototype.getBigInt64()DataView.prototype.getBigUint64()DataView.prototype.getFloat16()DataView.prototype.getFloat32()DataView.prototype.getFloat64()DataView.prototype.getInt8()DataView.prototype.getInt16()DataView.prototype.getInt32()DataView.prototype.getUint8()DataView.prototype.getUint16()DataView.prototype.getUint32()DataView.prototype.setBigInt64()DataView.prototype.setBigUint64()DataView.prototype.setFloat16()DataView.prototype.setFloat32()DataView.prototype.setFloat64()DataView.prototype.setInt8()DataView.prototype.setInt16()DataView.prototype.setInt32()DataView.prototype.setUint8()DataView.prototype.setUint16()DataView.prototype.setUint32()Object/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |