Added cast from half to numeric [skip ci]

This commit is contained in:
Andrew Kane
2023-12-04 12:38:34 -08:00
parent 4b630d4f27
commit 95eff595f0
5 changed files with 53 additions and 5 deletions

View File

@@ -58,6 +58,12 @@ SELECT '{1,2,3}'::half[];
{1,2,3}
(1 row)
SELECT '{1,2,3}'::half[]::real[];
float4
---------
{1,2,3}
(1 row)
SELECT '65505'::integer::half;
half
-------
@@ -82,10 +88,22 @@ SELECT '1.5'::half::real;
1.5
(1 row)
SELECT '{1.5}'::half[]::real[];
float4
--------
{1.5}
SELECT '1.5'::real::half;
half
------
1.5
(1 row)
SELECT '1.5'::half::numeric;
numeric
---------
1.5
(1 row)
SELECT '1.5'::numeric::half;
half
------
1.5
(1 row)
SELECT l2_distance('{0,0}'::half[], '{3,4}'::half[]);

View File

@@ -12,13 +12,17 @@ SELECT '1.5 '::half;
SELECT '1.5a'::half;
SELECT '{1,2,3}'::half[];
SELECT '{1,2,3}'::half[]::real[];
SELECT '65505'::integer::half;
SELECT 'NaN'::real::half;
SELECT 'Infinity'::real::half;
SELECT '1.5'::half::real;
SELECT '{1.5}'::half[]::real[];
SELECT '1.5'::real::half;
SELECT '1.5'::half::numeric;
SELECT '1.5'::numeric::half;
SELECT l2_distance('{0,0}'::half[], '{3,4}'::half[]);
SELECT l2_distance('{0,0}'::half[], '{0,1}'::half[]);