Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. JavaScript
  3. Reference
  4. Standard built-in objects
  5. Math
  6. cbrt()

Math.cbrt()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

TheMath.cbrt() static method returns the cube root of a number. That is

𝙼𝚊𝚝𝚑.𝚌𝚋𝚛𝚝(𝚡)=x3=the unique y such that y3=x\mathtt{\operatorname{Math.cbrt}(x)} = \sqrt[3]{x} = \text{the unique } y \text{ such that } y^3 = x

Try it

console.log(Math.cbrt(-1));// Expected output: -1console.log(Math.cbrt(1));// Expected output: 1console.log(Math.cbrt(Infinity));// Expected output: Infinityconsole.log(Math.cbrt(64));// Expected output: 4

Syntax

js
Math.cbrt(x)

Parameters

x

A number.

Return value

The cube root ofx.

Description

Becausecbrt() is a static method ofMath, you always use it asMath.cbrt(), rather than as a method of aMath object you created (Math is not a constructor).

Examples

Using Math.cbrt()

js
Math.cbrt(-Infinity); // -InfinityMath.cbrt(-1); // -1Math.cbrt(-0); // -0Math.cbrt(0); // 0Math.cbrt(1); // 1Math.cbrt(2); // 1.2599210498948732Math.cbrt(Infinity); // Infinity

Specifications

Specification
ECMAScript® 2026 Language Specification
# sec-math.cbrt

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp