Definition and usage: is_infinite () determines whether it is an infinite value. Syntax: the is_infinite (x) parameter description x is required and specifies the value to be checked. Note: If x is positive or negative, for example, log (... definition and usage: is_infinite () determines whether it is an infinite value.
Syntax:Is_infinite (x)
Parameter description
X is required, which specifies the value to be checked.
Note:If x is infinite (positive or negative), for example, the result of log (0) or any value beyond the floating point range of the platform, true is returned. the instance code is as follows:
Function is_w_x_z ($ number) // custom function extension judgment function {if (is_infinite ($ number) // judge the value {echo $ number. "is an infinite value! "; // Output content based on the judgment result} else // if the judgment result is not true {echo $ number." is a finite value! "; // Output the corresponding content} is_w_x_z (9999999999999999999999999999999999); // call the function, and the return value of 1e + 034 is limited! Echo"
"; Is_w_x_z (log (0); // call the function and return-1. # inf is an infinite value! Echo"
"; Is_w_x_z (130); // call the function. The return value of 130 is a finite value!
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 required. length of edge y.
Note:The hypot () function calculates the length of the oblique side of x and y based on the two straight side lengths of the right triangle, or the distance from the coordinate point (x, y) to the origin, the algorithm of this function is equivalent to sqrt (x * x + y * y ).
Echo "if the right corner side of a triangle is 3 or 4, the oblique side is:"; echo"
"; Echo hypot (3, 4); // return 5 echo"
"; Echo" if the right corner side of a triangle is 5 or 13, the oblique side is: "; echo"
"; Echo hypot (5, 12); // return 13
Permanent address:
Reprint at will ~ Please bring the tutorial URL ^