DataView.prototype.getFloat32()
DataView 实例的 getFloat32() 方法从该 DataView 的指定字节偏移量开始读取 4 个字节,并将它们解释为 32 位浮点数。没有对齐约束;多字节值可以从边界内的任何偏移量获取。
¥The getFloat32() method of DataView instances reads 4 bytes starting at the specified byte offset of this DataView and interprets them as a 32-bit floating point number. There is no alignment constraint; multi-byte values may be fetched from any offset within bounds.
Try it
语法
参数
¥Parameters
byteOffset-
从读取数据的视图开始的偏移量(以字节为单位)。
littleEndianOptional-
表示数据是否以 小端或大端 格式存储。如果是
false或undefined,则读取大端值。
返回值
例外情况
示例
使用 getFloat32()
规范
| Specification |
|---|
| ECMAScript Language Specification # sec-dataview.prototype.getfloat32 |
浏览器兼容性
BCD tables only load in the browser
也可以看看
¥See also