is_finite


finite apg

VERIFY THAT a given value, NORMALLY NUMERIC, under certain conditions, CAN BE CONSIDERED as a FINITE VALUE and can be represented perfectly within the platform in use.





This function returns a TRUE if $num is a legal FINITE NUMBER within the allowed range for a PHP float on this platform or FALSE otherwise.



<?php


bool is_finite 
float $num )

where,

$num The value to check

?>
 

$num


The value to be checked.



  1 EXERCISE   

<?php

function isfinite($val)
{
    if(
is_finite($val))
    {
        echo 
'The input value ' $val 
              
' must be considered as a finite value.<br><br>'
    }
    else
    {
        echo 
'The entered value ' $val 
        
' should NOT be considered as a finite value.<br><br>';
    }
}

$v01 3.1416;

$v02 '18.448E+464';

isfinite($v01);

isfinite($v02);

?> 

 RESULT   

The input value 3.1416 must be considered as a finite value.

The entered value 8.448E+464 should NOT be considered as a finite value.