mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-03 03:00:56 +08:00
Added cast from half to numeric [skip ci]
This commit is contained in:
@@ -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[]);
|
||||
|
||||
@@ -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[]);
|
||||
|
||||
Reference in New Issue
Block a user