is_infinite


infinete apg

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





This function returns a TRUE if $num is INFINITE, (POSITIVE or NEGATIVE), like the result of log(0) or any value too big to fit into a float on this platform.



<?php


bool is_infinite 
( float $num )

where,

$num = The value to check

?>
 

$num


The value to br checked.



  1 EXERCISE   

<?php

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

$v01 = 3.1416;

$v02 = '18.448E+464';

isinfinite($v01);

isinfinite($v02);

?> 

 RESULT   

The input value 3.1416 should NOT be considered as a infinite value.

The entered value 18.448E+464 must be considered as a infinite value.