Skip to content

Instantly share code, notes, and snippets.

@nileema
Created September 27, 2013 20:10
Show Gist options
  • Save nileema/6734480 to your computer and use it in GitHub Desktop.
Save nileema/6734480 to your computer and use it in GitHub Desktop.
presto:default> select is_nan(nan());
_col0
-------
true
(1 row)
presto:default> select nan();
_col0
-------
NaN
(1 row)
presto:default> select infinity();
_col0
----------
Infinity
(1 row)
presto:default> select is_infinite(1.0/0.0);
_col0
-------
true
(1 row)
presto:default> select is_nan(0.0/0.0);
_col0
-------
true
(1 row)
presto:default> select is_nan(infinity()/infinity());
_col0
-------
true
(1 row)
presto:default> select is_finite(infinity()/infinity());
_col0
-------
false
(1 row)
presto:default> select is_finite(1000);
_col0
-------
true
(1 row)
presto:default> select -rand()/0.0;
_col0
-----------
-Infinity
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment