From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- .../reference/global_objects/math/cbrt/index.html | 98 ++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 files/ko/web/javascript/reference/global_objects/math/cbrt/index.html (limited to 'files/ko/web/javascript/reference/global_objects/math/cbrt/index.html') diff --git a/files/ko/web/javascript/reference/global_objects/math/cbrt/index.html b/files/ko/web/javascript/reference/global_objects/math/cbrt/index.html new file mode 100644 index 0000000000..20a5f3ee3a --- /dev/null +++ b/files/ko/web/javascript/reference/global_objects/math/cbrt/index.html @@ -0,0 +1,98 @@ +--- +title: Math.cbrt() +slug: Web/JavaScript/Reference/Global_Objects/Math/cbrt +tags: + - JavaScript + - Math + - Method + - Reference + - 세제곱근 +translation_of: Web/JavaScript/Reference/Global_Objects/Math/cbrt +--- +
{{JSRef}}
+ +

Math.cbrt() 함수는 주어진 수의 세제곱근을 반환합니다. 즉,

+ +

Math.cbrt(x)=x3=the uniqueysuch thaty3=x\mathtt{Math.cbrt(x)} = \sqrt[3]{x} = \text{the unique} \; y \; \text{such that} \; y^3 = x

+ +

구문

+ +
Math.cbrt(x)
+ +

매개변수

+ +
+
x
+
숫자.
+
+ +

반환 값

+ +

주어진 수의 세제곱근.

+ +

설명

+ +

cbrt()는 Math의 정적 메서드이므로, 사용자가 생성한 Math 객체의 메서드로 호출할 수 없고 항상 Math.cbrt()를 사용해야 합니다. (Math는 생성자가 아닙니다)

+ +

예제

+ +

Math.cbrt() 사용하기

+ +
Math.cbrt(NaN); // NaN
+Math.cbrt(-1); // -1
+Math.cbrt(-0); // -0
+Math.cbrt(-Infinity); // -Infinity
+Math.cbrt(0); // 0
+Math.cbrt(1); // 1
+Math.cbrt(Infinity); // Infinity
+Math.cbrt(null); // 0
+Math.cbrt(2);  // 1.2599210498948734
+
+ +

폴리필

+ +

모든 x0x \geq 0에서 x3=x1/3\sqrt[3]{x} = x^{1/3} 이므로, Math.cbrt()는 다음 함수로 폴리필할 수 있습니다.

+ +
if (!Math.cbrt) {
+  Math.cbrt = (function(pow) {
+    return function cbrt(){
+      // ensure negative numbers remain negative:
+      return x < 0 ? -pow(-x, 1/3) : pow(x, 1/3);
+    };
+  })(Math.pow); // localize Math.pow to increase efficiency
+}
+ +

명세

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('ES6', '#sec-math.cbrt', 'Math.cbrt')}}{{Spec2('ES6')}}Initial definition.
{{SpecName('ESDraft', '#sec-math.cbrt', 'Math.cbrt')}}{{Spec2('ESDraft')}} 
+ +

브라우저 호환성

+ + + +

{{Compat("javascript.builtins.Math.cbrt")}}

+ +

같이 보기

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