complex
complex_contrib · Complex-number data type for PostgreSQL.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100206 | complex | complex_contrib | 1.0 | TYPE | Unknown | C |
Usage
Sources:
complex defines a 16-byte complex-number type backed by two float8 components. Version 1.0 provides arithmetic and comparison operators, implicit casts from int4 and float8, sum, min, max, avg, and complex_pwrt(complex,int4).
The SQL API defines a total ordering for <, <=, >, >=, min, and max, but complex numbers have no natural mathematical order. Inspect and test the implementation’s chosen ordering before using it for business logic or sorted indexes. Floating-point equality also inherits NaN, infinity, signed-zero, rounding, and platform concerns.
The repository has no user README or release notes. Establish accepted text syntax, power-function row semantics, divide-by-zero behavior, overflow, binary dump/restore, and PostgreSQL-major compatibility on the exact build. Use core numeric pairs or an application math library when portability and a documented numerical contract matter.