cmath
postgres-cmath · C11 math functions exposed to PostgreSQL with C-backed implementations.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100698 | cmath | postgres-cmath | 1.2 | FUNC | GPL-3.0 | C |
Usage
Sources:
cmath exposes ISO C <math.h> functions with a c_ prefix, including single-precision variants and functions not traditionally present in PostgreSQL. Unlike PostgreSQL numeric functions, the C functions commonly return IEEE-754 NaN or infinity for domain and overflow cases instead of raising an SQL error.
Results follow the platform C library, so edge cases can vary across operating systems and architectures. Callers should explicitly reject non-finite values when downstream constraints, JSON serialization, indexes, or analytics require finite numbers. The reviewed version is 1.2; test numerical behavior on the exact target platform before relying on reproducibility.