[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat16 [Back]  [Original]

DataView.prototype.getFloat16() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

DataView.prototype.getFloat16()

Baseline 2025
Newly available

Since 2025 4, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

DataView getFloat16() DataView 2 16 . , .

In this article

// 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

js
getFloat16(byteOffset)
getFloat16(byteOffset, littleEndian)

byteOffset

( ).

littleEndian Optional

. false undefined .

-65504 65504 .

RangeError

byteOffset .

getFloat16()

js
const { buffer } = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
const dataview = new DataView(buffer);
console.log(dataview.getFloat16(1)); // 0.00001537799835205078

Specification
ECMAScript 2027 LanguageSpecification
# sec-dataview.prototype.getfloat16


Web Proxy Viewer  |  New URL  |  Original Page