DataView.prototype.getFloat16()
DataView 实例的 getFloat16() 方法从此 DataView 的指定字节偏移量开始读取 2 个字节,并将它们解释为 16 位浮点数。没有对齐约束;多字节值可以从边界内的任何偏移量获取。
¥The getFloat16() method of DataView instances reads 2 bytes starting at the specified byte offset of this DataView and interprets them as a 16-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,则读取大端值。
返回值
例外情况
示例
使用 getFloat16()
规范
| Specification |
|---|
| Float16Array # sec-dataview.prototype.getfloat16 |
浏览器兼容性
BCD tables only load in the browser