fdim(3) Library Functions Manual fdim(3) fdim, fdimf, fdiml - (libm, -lm) #include double fdim(double x, double y); float fdimf(float x, float y); long double fdiml(long double x, long double y); glibc (. feature_test_macros(7)): fdimf(), fdiml(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L These functions return the positive difference, max(x-y,0), between their arguments. . x y NaN, NaN. , HUGE_VAL, HUGE_VALF HUGE_VALL, . math_error(7), , . : : errno ERANGE. (FE_OVERFLOW). attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |fdim(), fdimf(), fdiml() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ C11, POSIX.1-2008. glibc 2.1. C99, POSIX.1-2001. Before glibc 2.24 on certain architectures (e.g., x86, but not x86_64) these functions did not set errno. fmax(3) () Azamat Hackimov , Dmitry Bolkhovskikh , Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () . Linux man-pages 6.18 8 2026 . fdim(3)