RosettaCodeData/Task/Extreme-floating-point-values/DuckDB/extreme-floating-point-values-1.duckdb
2025-08-11 18:05:26 -07:00

8 lines
426 B
Text

select x, typeof(x), x + 0.0, x - x
from unnest([NULL::FLOAT, 'Infinity'::FLOAT, '-Infinity'::FLOAT, 'NaN'::FLOAT, '-NaN'::FLOAT]) _(x);
select x, typeof(x), x + 0.0, x - x
from unnest([NULL::DOUBLE, 'Infinity'::DOUBLE, '-Infinity'::FLOAT,'NaN'::DOUBLE, '-NaN'::DOUBLE]) _(x);
select x, x + 1::INTEGER, x = x, x is null
from unnest([NULL::DOUBLE, 'Infinity'::DOUBLE, '-Infinity'::FLOAT,'NaN'::DOUBLE, '-NaN'::DOUBLE]) _(x);