Skip to main content
Version: Java (Groovy)

NaNs

NaN, or not-a-number, values indicate non-numeric results that come from computations on a dataset.

Example

Deephaven supports constants for NaN values.

result = newTable(
floatCol("Floats", Float.NaN),
doubleCol("Doubles", Double.NaN)
)

NaNs typically come from computations on datasets. The following example shows how NaNs might end up in a table.

source = newTable(
floatCol("NaNFloat", (float)-1.0),
doubleCol("NaNDouble", -1.0),

).update(
"NaNFloat = java.lang.Math.sqrt(NaNFloat)",
"NaNDouble = java.lang.Math.sqrt(NaNDouble)"
)

NaN values can be detected using the isNaN filter.

result = source.update(
"NaNFloatNaN = isNaN(NaNFloat)",
"NaNDoubleNaN = isNaN(NaNDouble)",
)