isinf
This page explains how to use the isinf function in APL.
Use the isinf function in APL to check whether a numeric value is positive or negative infinity. The function returns true only when the value is ±∞ and false for all finite values and NaN.
isinf is useful for detecting overflow conditions or division-by-zero results in computed columns. Unlike isfinite, which also catches NaN values, isinf specifically targets infinite results, allowing you to distinguish overflow from undefined computations.
Usage
Syntax
isinf(x)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
x | real | Yes | The numeric value to check. |
Returns
true if x is positive or negative infinity. false for finite values and NaN.
List of related functions
- isfinite: Returns
truefor values that are neither infinite nor NaN. Use it for a broader check covering all invalid float states. - isnan: Returns
trueonly for NaN values. Use it alongsideisinfto detect the other class of invalid float. - isint: Returns
truefor integer values. Use it when you need to validate that a value is a whole number. - not: Reverses a boolean value. Use
not(isinf(x))as a shorthand forisfinite(x)when NaN values aren't a concern. - log: Returns the natural logarithm. Compute
logon potentially zero or negative values and useisinfto detect the resulting-inf.