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

DataView.prototype.getFloat32() - 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.getFloat32()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

DataView getFloat32() DataView 4 32 . , .

In this article

// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);

const view = new DataView(buffer);
view.setFloat32(1, Math.PI);

console.log(view.getFloat32(1));
// Expected output: 3.1415927410125732

js
getFloat32(byteOffset)
getFloat32(byteOffset, littleEndian)

byteOffset

( ).

littleEndian Optional

. false undefined .

-3.4e38 3.4e38 .

RangeError

byteOffset .

getFloat32()

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

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


Web Proxy Viewer  |  New URL  |  Original Page