MCPcopy Create free account
hub / github.com/apache/madlib / array_sqrt

Function array_sqrt

methods/array_ops/src/pg_gp/array_ops.c:767–781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765 */
766PG_FUNCTION_INFO_V1(array_sqrt);
767Datum
768array_sqrt(PG_FUNCTION_ARGS){
769 if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); }
770
771 ArrayType *x = PG_GETARG_ARRAYTYPE_P(0);
772 ArrayType *v1 = array_to_float8_array(x);
773 Datum v2 = 0;
774
775 ArrayType *res = General_Array_to_Array(v1, v2, element_sqrt);
776
777 if (v1 != x) { pfree(v1); }
778 PG_FREE_IF_COPY(x, 0);
779
780 PG_RETURN_ARRAYTYPE_P(res);
781}
782
783/*
784 * This function takes the power for each element.

Callers

nothing calls this directly

Calls 2

array_to_float8_arrayFunction · 0.85
General_Array_to_ArrayFunction · 0.85

Tested by

no test coverage detected