mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-07 13:10:56 +08:00
Added cast from half to real [skip ci]
This commit is contained in:
13
src/half.c
13
src/half.c
@@ -439,6 +439,19 @@ float4_to_half(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_HALF(h);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert half to float4
|
||||
*/
|
||||
PGDLLEXPORT PG_FUNCTION_INFO_V1(half_to_float4);
|
||||
Datum
|
||||
half_to_float4(PG_FUNCTION_ARGS)
|
||||
{
|
||||
half h = PG_GETARG_HALF(0);
|
||||
float f = HalfToFloat4(h);
|
||||
|
||||
PG_RETURN_FLOAT4(f);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the L2 distance between half arrays
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user