isFinite
isFinite
returns a boolean value indicating whether or not the specified value is normal, where normal is defined as not null, not infinite, and not NaN.
Syntax
isFinite(value)
Parameters
Parameter | Type | Description |
---|---|---|
value | byte | The value to check. |
value | double | The value to check. |
value | float | The value to check. |
value | int | The value to check. |
value | long | The value to check. |
value | short | The value to check. |
value | Byte | The value to check. |
value | Double | The value to check. |
value | Float | The value to check. |
value | Integer | The value to check. |
value | Long | The value to check. |
value | Short | The value to check. |
Returns
true
if the value parameter is normal; false
otherwise.
Examples
The following example shows how isFinite
interacts with various objects within a table.
source = newTable(
floatCol("Float", (float)1.0),
floatCol("NullFloat", NULL_FLOAT),
floatCol("NaNFloat", (float)-1.0),
doubleCol("Double", 1.0),
doubleCol("NullDouble", NULL_DOUBLE),
doubleCol("NaNDouble", -1.0),
).update(
"NaNFloat = java.lang.Math.sqrt(NaNFloat)",
"NaNDouble = java.lang.Math.sqrt(NaNDouble)"
)
result = source.update(
"FloatNormal = isFinite(Float)",
"NullFloatNormal = isFinite(NullFloat)",
"NaNFloatNormal = isFinite(NaNFloat)",
"DoubleNormal = isFinite(Double)",
"NullDoubleNormal = isFinite(NullDouble)",
"NaNDoubleNormal = isFinite(NaNDouble)",
)
- source
- result