Overview
ISO/IEC 24747:2009 specifies standardized extensions to the C Standard Library (ISO/IEC 9899) to provide a consistent set of mathematical special functions for C programmers and library implementers. The standard adds function prototypes (with float, double and long double variants) to the headers **** and ****, and defines preprocessor controls for exposing these facilities in a portable way.
Key topics and technical requirements
- Scope and relation to C: Extensions are defined by reference to ISO/IEC 9899; unless suppressed, the full C Standard Library is included.
- Header additions: New function declarations are added to **** and **** when the macro STDC_WANT_MATH_SPEC_FUNCS is defined as 1 at inclusion time.
- Conformance macro: Implementations may define STDC_MATH_SPEC_FUNCS (value 200808) to indicate conformance to this International Standard.
- Function set: The standard lists numerous special functions, including (examples):
- Bessel functions: cyl_bessel_i, cyl_bessel_j, cyl_bessel_k, cyl_neumann and spherical variants
- Orthogonal polynomials: assoc_laguerre, assoc_legendre, hermite, laguerre, legendre, sph_legendre
- Elliptic integrals: comp_ellint_1/2/3 and ellint_1/2/3 (complete and incomplete)
- Special functions: beta, expint (exponential integral), riemann_zeta
- Type variants: Each function is provided in three signatures (float, double, long double), following standard C naming conventions (e.g., func, funcf, funcl).
- Error and NaN behavior: Functions must return NaN if any argument is NaN and follow the standard rules for reporting domain errors only where mathematically applicable.
- Preprocessor consistency: STDC_WANT_MATH_SPEC_FUNCS must be defined identically for all inclusions of the special-function headers within a translation unit.
Applications - who uses this standard
- Library and compiler implementers: To provide portable, standards-compliant math libraries for C runtime environments.
- Scientific and numerical computing: Researchers and engineers who need reliable implementations of special functions (Bessel, Legendre, elliptic integrals, Riemann zeta) for simulations, signal processing, physics, and computational mathematics.
- Cross-platform development: Developers writing portable C code that relies on advanced mathematical functionality can target ISO/IEC 24747:2009-compliant platforms for predictable behavior.
- Embedded and high-assurance systems: Where conformance and well-defined behavior of mathematical functions are required.
Related standards
- ISO/IEC 9899:1999 (and corrigenda) - The C programming language standard that ISO/IEC 24747 extends.
- Header semantics also interact with standard C preprocessor macros and error-handling conventions defined in the C Standard.
Keywords: ISO/IEC 24747:2009, C Standard Library extensions, mathematical special functions, math.h, tgmath.h, Bessel, Legendre, Laguerre, elliptic integrals, Riemann zeta, numerical computing, C programming.