Added cast from half to real [skip ci]

This commit is contained in:
Andrew Kane
2023-12-04 12:27:13 -08:00
parent 3b2198d52c
commit 4b630d4f27
5 changed files with 40 additions and 0 deletions

View File

@@ -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
*/