Definition and usage
Is_infinite () determines whether it is an infinite value.
Syntax
Is_infinite (x) parameter description
X is required. Specifies the value to be checked.
Description
If x is infinite (positive or negative), for example, log (0) results or any value beyond the floating point range of the platform, true is returned.
Function is_w_x_z ($ number) // customize the function Extension judgment function
{
If (is_infinite ($ number) // determines the value.
{
Echo $ number. "is an infinite value! "; // Output content based on the judgment result
}
Else // if the result is not true
{
Echo $ number. "is a finite value! "; // Output the corresponding content
}
}
Is_w_x_z (9999999999999999999999999999999999); // call the function. The return value of 1e + 034 is limited!
Echo "<br> ";
Is_w_x_z (log (0); // call the function and return-1. # inf is an infinite value!
Echo "<br> ";
Is_w_x_z (130); // call the function. The return value of 130 is finite!
Hypot () function is used to calculate the length of the Oblique Edge of the angular triangle.
Syntax
Hypot (x, y) parameter description
X is required. The length of edge x.
Y is required. The length of edge y.
Description
The hypot () function calculates the length of the Oblique Edge Based on the two straight side lengths x and y of the right triangle. Or the distance from the Punctuation Point (x, y) to the origin point. The algorithm of this function is equivalent to sqrt (x * x + y * y ).
Echo "if the right-angle triangle's right-angle side is 3 or 4, the oblique side is :";
Echo "<br> ";
Echo hypot (3, 4); // returns 5
Echo "<br> ";
Echo "the oblique side of a right triangle is 5 or 13 :";
Echo "<br> ";
Echo hypot (5, 12); // return 13