IsInfinite ( double value );
Description
Returns true
if the specified number is infinitely large in magnitude.
Input parameters
Parameter | Default value | Description |
---|---|---|
value | - | Defines value to test. |
Example 1
declare lower;
input dividend = 10;
input divisor = 0;
def tempResult = dividend / divisor;
plot Result = if IsInfinite(tempResult) then 0 else tempResult;
The example draws the result of division the dividend
by the divisor
on a separate subgraph. If the divisor
is equal to zero then the division produces the infine number. The IsInfinite
function returns true
as a result of verifying the infinite number and the result is assigned 0
.
Example 2
declare lower;
input dividend = 10;
input divisor = 0;
plot Result = if divisor == 0 then 0 else dividend / divisor;
This example is similar to the previous one. But here the validation is performed before the division which makes the code simplier.