PHP Math functions sqrt
$number is the input value for which square root is required.
We can get square root of a math number by using sqrt function
Here are some examples
Note that for negative numbers we will get output as NAN mean not a number . We can verify this output by using is_nan function.
Hypotenuse of a right angle triangleIn a right angled triangle we have two sides of right angle as a & b. The hypotenuse of the triangle is known as h . We have to find the value of it.
We will use POW function to get the square of each side. Then we will add them and take the square root of the sum.
Here is the code.
Output is 5
Subscribe to our YouTube Channel here
This article is written by plus2net.com team. https://www.plus2net.com