Home > Backend Development > PHP Tutorial > How to calculate if PHP is raised to the nth power?

How to calculate if PHP is raised to the nth power?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-04 09:21:15
Original
2250 people have browsed it

PHP has the square root function sqrt(), but now I want to raise the 1.2th power of a number. Is there any good way? Can you only write a function yourself?

Reply content:

PHP has the square root function sqrt(), but now I want to raise the 1.2th power of a number. Is there any good way? Can you only write a function yourself?

Wrong reading=. = , use pow(). Mathematical principles The square root of 25 will be 25 raised to the 1/2 power, so the 1.2 raised power of 25 will be 25 raised to the 1/1.2 power pow(25,1/1.2)

Use the pow() function, for example, 100 raised to the power 1.2 is 100 raised to the power 1/1.2, written as pow(100,1/1.2)

php5.6 uses echo 25**(1/1.2);//14.620088691064

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template