isfinite()
Learn how to use the isfinite() function to check if the input is a finite value.
Returns whether the input is a finite value, meaning it’s not infinite or NaN.
Syntax
isfinite(number)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| number | real | ✔️ | The value to check if finite. |
Returns
true if x is finite and false otherwise.
Example
range x from -1 to 1 step 1
| extend y = 0.0
| extend div = 1.0*x/y
| extend isfinite=isfinite(div)
Output
| x | y | div | isfinite |
|---|---|---|---|
| -1 | 0 | -∞ | 0 |
| 0 | 0 | NaN | 0 |
| 1 | 0 | ∞ | 0 |
Related content
- To check if a value is null, see isnull().
- To check if a value is infinite, see isinf().
- To check if a value is NaN (Not-a-Number), see isnan().
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.