| 1296 | } |
| 1297 | |
| 1298 | Datum |
| 1299 | numeric2complex(PG_FUNCTION_ARGS) |
| 1300 | { |
| 1301 | Numeric num = PG_GETARG_NUMERIC(0); |
| 1302 | double float_num; |
| 1303 | |
| 1304 | if (NUMERIC_IS_NAN(num)) |
| 1305 | { |
| 1306 | float_num = get_float8_nan(); |
| 1307 | } |
| 1308 | else |
| 1309 | { |
| 1310 | float_num = DatumGetFloat8(DirectFunctionCall1(numeric_float8, NumericGetDatum(num))); |
| 1311 | } |
| 1312 | |
| 1313 | PG_RETURN_COMPLEX_P(construct_complex_in(float_num, 0)); |
| 1314 | } |
| 1315 | |
| 1316 | /* |
| 1317 | * complex_dot_product - returns dot product of two 1-dim array with the same size |
nothing calls this directly
no test coverage detected