PHP is finite

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PHP : is_finite() function

Description

The is_finite() function is used to find whether a value is finite or not.

Version

(PHP 4 and above)

Syntax

is_finite (num)

Parameter

Name

Description

Required /
Optional

Type

num

The value to be checked. 

Required

Float

 

Return value

TRUE if num is finite number otherwise FALSE.

Value Type : Boolean.

Pictorial representation of is_finite() function

php math is_fiinite()

Example of php is_finite() function

  1. $fval1=10.21;  

  2. $fval2=-50.85;  

  3. $zisf1=is_finite($fval1);  

  4. $zisf2=is_finite($fval2);  

  5. $zisf3=is_finite($fval3);  

  6. echo "$fval1 is is_finite : $zisf1
    ";  

  7. echo "$fval2 is is_finite : $zisf2
    ";  

  8. echo "$fval3 is is_finite : $zisf3
    ";  

  9. ?>   

Output of the example

10.21 is is_finite : 1
-50.85 is is_finite : 1
-INF is is_finite :