IsInfinity()

Syntax

Result.f(.d) = IsInfinity(Value.f(.d))
Description
Returns nonzero if the given value represents positive or negative infinity.

Parameters

Value.f or Value.d The value to check for infinity.

Return value

Returns nonzero if the input value represents positive or negative infinity and zero otherwise.

Remarks

Checking for the infinity values should not be done using normal comparison, because it depends on the hardware implementation whether infinity is considered equal to itself or not. The value of positive infinity can be generated with the Infinity() function.

This function handles and returns float or double values.

Example

  Result = IsInfinity(Infinity())  ; infinity
  Result = IsInfinity(Log(0))      ; -infinity
  Result = IsInfinity(1234.5)      ; a finite number
  Result = IsInfinity(NaN())       ; NaN is not the same as infinity

See Also

Infinity(), IsNaN()

Supported OS

All

<- IntQ() - Math Index - IsNaN() ->