Get the App
SLTechnology News&Howtos  ›  Development  › 

Which is the function of javascript to find the power of n?

Shulou Source: shulou.com Published: 2022-06-02 16:53:47 10月02日 Update

Editor to share with you which is the function of javascript to the power of n. I hope you will get something after reading this article. Let's discuss it together.

In javascript, the function to find the power of n is pow (); the pow () function of the Math object can calculate the n-th power of a specified number, the syntax "Math.pow (numeric, n)".

The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.

In javascript, the function to find the power n is pow ().

Syntax: Math.pow (x, y)

This function calculates and returns the value of the y power of x, that is, the y power of x.

Console.log (Math.pow (0,1)); console.log (Math.pow (1,1)); console.log (Math.pow (2,1)); console.log (Math.pow (2,2)); console.log (Math.pow (2,3))

If the result of the evaluation is an imaginary number, the method returns NaN. If a floating-point overflow occurs because the index is too large, the method returns Infinity.

After reading this article, I believe you have a certain understanding of "which is the function of javascript to the power of n". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Tags: Functions methods articles grammar finishes objects indices tutorials numerical values more floating points environments computers knowledge systems results imaginary numbers industries information information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info vpn Linux Huawei Microsoft