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/math/sqrt1_2/index.html | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 files/zh-cn/web/javascript/reference/global_objects/math/sqrt1_2/index.html (limited to 'files/zh-cn/web/javascript/reference/global_objects/math/sqrt1_2') diff --git a/files/zh-cn/web/javascript/reference/global_objects/math/sqrt1_2/index.html b/files/zh-cn/web/javascript/reference/global_objects/math/sqrt1_2/index.html new file mode 100644 index 0000000000..47e0557901 --- /dev/null +++ b/files/zh-cn/web/javascript/reference/global_objects/math/sqrt1_2/index.html @@ -0,0 +1,100 @@ +--- +title: Math.SQRT1_2 +slug: Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2 +translation_of: Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2 +--- +
+ {{JSRef("Global_Objects", "Math")}}
+

概述

+

Math.SQRT1_2 属性表示 1/2 的平方根,约为 0.707:

+

Math.SQRT1_2=12=120.707\mathtt{\mi{Math.SQRT1_2}} = \sqrt{\frac{1}{2}} = \frac{1}{\sqrt{2}} \approx 0.707

+
+ {{js_property_attributes(0,0,0)}}
+

描述

+

由于 SQRT1_2Math 对象的静态属性,所以应该像这样使用:Math.SQRT1_2,而不是作为你创建的 Math 实例的属性(Math 不是构造函数)。

+

示例

+

例子:使用 SQRT1_2

+

下面的函数返回 1/2 的平方根:

+
function getRoot1_2() {
+   return Math.SQRT1_2
+}
+
+getRoot1_2() // 0.7071067811865476
+

+

规范

+ + + + + + + + + + + + + + + + + + + + + + + +
规范版本规范状态注解
ECMAScript 1st Edition. Implemented in JavaScript 1.0StandardInitial definition.
{{SpecName('ES5.1', '#sec-15.8.1.7', 'Math.SQRT1_2')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-math.sqrt1_2', 'Math.SQRT1_2')}}{{Spec2('ES6')}} 
+

浏览器兼容性

+

{{ CompatibilityTable() }}

+
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
+
+
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
+
+

相关链接

+ -- cgit v1.2.3-54-g00ecf