diff --git a/test/expected/halfvec_functions.out b/test/expected/halfvec_functions.out index f05f5c1..222b856 100644 --- a/test/expected/halfvec_functions.out +++ b/test/expected/halfvec_functions.out @@ -156,3 +156,21 @@ SELECT subvector('[1,2,3,4,5]'::halfvec, 3, -1); ERROR: halfvec must have at least 1 dimension SELECT subvector('[1,2,3,4,5]'::halfvec, -1, 2); ERROR: halfvec must have at least 1 dimension +SELECT round(halfvec_norm('[1,1]')::numeric, 5); + round +--------- + 1.41421 +(1 row) + +SELECT halfvec_norm('[3,4]'); + halfvec_norm +-------------- + 5 +(1 row) + +SELECT halfvec_norm('[0,1]'); + halfvec_norm +-------------- + 1 +(1 row) + diff --git a/test/sql/halfvec_functions.sql b/test/sql/halfvec_functions.sql index 73e3921..1fc086a 100644 --- a/test/sql/halfvec_functions.sql +++ b/test/sql/halfvec_functions.sql @@ -34,3 +34,7 @@ SELECT subvector('[1,2,3,4,5]'::halfvec, 3, 9); SELECT subvector('[1,2,3,4,5]'::halfvec, 1, 0); SELECT subvector('[1,2,3,4,5]'::halfvec, 3, -1); SELECT subvector('[1,2,3,4,5]'::halfvec, -1, 2); + +SELECT round(halfvec_norm('[1,1]')::numeric, 5); +SELECT halfvec_norm('[3,4]'); +SELECT halfvec_norm('[0,1]');