How to get the NaN value in BigQuery?

Viewed 39

Is there a way to get a NaN value directly in BigQuery? For example, I'm trying to get all the 'special' float values BQ supports, but what's the way to generate the NaN?:

SELECT   1e500,    -1e500,    1e-500,  -1e-500,   ???
   --    Infinity  -Infinity  0.0      0.0        NaN

Is the only way to do CAST('NaN' AS float64) ? Or is there a way to represent it with scientific notation?

1 Answers

Another options (few out of many similar - you got an idea)

SELECT IEEE_DIVIDE(0, 0), LOG(1, 1e500)  

with output

enter image description here

Related