| 1128 | } |
| 1129 | |
| 1130 | static |
| 1131 | inline |
| 1132 | Datum |
| 1133 | average_root_finalize(Datum elt,int size,Oid element_type){ |
| 1134 | float8 value = datum_float8_cast(elt, element_type); |
| 1135 | if (size == 0) { |
| 1136 | return Float8GetDatum(0); |
| 1137 | } else if (size == 1) { |
| 1138 | return Float8GetDatum(0); |
| 1139 | } else { |
| 1140 | return Float8GetDatum(sqrt(value/((float8)size - 1))); |
| 1141 | } |
| 1142 | } |
| 1143 | |
| 1144 | /* ----------------------------------------------------------------------- |
| 1145 | * Type cast functions |
nothing calls this directly
no test coverage detected