IsInfinity()

Syntax

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

Parameters

Value.f 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 can handle float and 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() ->