From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../global_objects/dataview/getfloat64/index.html | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 files/zh-cn/web/javascript/reference/global_objects/dataview/getfloat64/index.html (limited to 'files/zh-cn/web/javascript/reference/global_objects/dataview/getfloat64') diff --git a/files/zh-cn/web/javascript/reference/global_objects/dataview/getfloat64/index.html b/files/zh-cn/web/javascript/reference/global_objects/dataview/getfloat64/index.html new file mode 100644 index 0000000000..885acb9421 --- /dev/null +++ b/files/zh-cn/web/javascript/reference/global_objects/dataview/getfloat64/index.html @@ -0,0 +1,91 @@ +--- +title: DataView.prototype.getFloat64() +slug: Web/JavaScript/Reference/Global_Objects/DataView/getFloat64 +translation_of: Web/JavaScript/Reference/Global_Objects/DataView/getFloat64 +--- +
{{JSRef}}
+ +

getFloat64()方法DataView相对于起始位置偏移 n 个字节处开始,获取一个64-bit数(双精度浮点型,8个字节).

+ +
{{EmbedInteractiveExample("pages/js/dataview-getfloat64.html")}}
+ + + +

语法

+ +
dataview.getFloat64(byteOffset [, littleEndian])
+ +

参数

+ +
+
byteOffset
+
偏移量, 单位为字节, 从头开始计算.
+
littleEndian
+
{{optional_inline}} Indicates whether the 64-bit float is stored in {{Glossary("Endianness", "little- or big-endian")}} format. If false or undefined, a big-endian value is read.
+
+ +

返回

+ +
+
一个双精度浮点型64位数.
+
+ +

抛出错误

+ +
+
{{jsxref("RangeError")}}
+
如果byteOffset超出了视图能储存的值,就会抛出错误.
+
+ +

描述

+ +
+
没有对齐约束; 多字节值可以从任何偏移量获取.
+
+ +

例子

+ +
var buffer = new ArrayBuffer(8);
+var dataview = new DataView(buffer);
+dataview.getFloat64(1); // 0
+
+ +

规范

+ + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Typed Array')}}{{Spec2('Typed Array')}}Superseded by ECMAScript 6.
{{SpecName('ES6', '#sec-dataview.prototype.getfloat64', 'DataView.prototype.getFloat64')}}{{Spec2('ES6')}}Initial definition in ECMA standard.
{{SpecName('ESDraft', '#sec-dataview.prototype.getfloat64', 'DataView.prototype.getFloat64')}}{{Spec2('ESDraft')}}
+ +

浏览器支持

+ + + +

{{Compat("javascript.builtins.DataView.getFloat64")}}

+ +

另见

+ + -- cgit v1.2.3-54-g00ecf