How to return "NaN" using SQRT function in Oracle SQL? How to return "NaN" using SQRT function in Oracle SQL?  Here is my unsuccessful attempt:

SELECT SQRT(4) AS "SQRT of 4",
       SQRT(0) AS "SQRT of 0",
       SQRT(-1) AS "SQRT of -1"
FROM DUAL;


As I understand, a successful query might use the TO_BINARY_DOUBLE function but additional approaches are welcome.
Cast the number, as you said:

SELECT SQRT(4) AS "SQRT of 4",
   SQRT(0) AS "SQRT of 0",
   SQRT(TO_BINARY_DOUBLE(-1)) AS "SQRT of -1"
FROM DUAL;