ISNAN
Description
The ISNAN
function is used to determine whether the given expression expr
is NaN
(Not a Number). When the value of expr
is NaN
, the function returns true
; otherwise, it returns false
. This function is mainly used to handle numerical anomalies and ensure data accuracy.
Parameter Description
expr
: The expression to be evaluated, of typedouble
.
Return Type
The return result is of type boolean
, i.e., true
or false
.
Usage Example
- Determine whether the string
'NaN'
isNaN
after being converted todouble
:
- Use the
ISNAN
function in a query to filterNaN
values:
In this example, if there are NaN
values in the total_amount
column, the ISNAN
function will return true
, thus helping to filter out these records.
- Determine whether a calculation result is
NaN
and perform conditional filtering based on the result: