round(3) Library Functions Manual round(3) round, roundf, roundl - (libm -lm) #include double round(double x); float roundf(float x); long double roundl(long double x); glibc ( feature_test_macros(7)): round(), roundf(), roundl(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L x ( fenv(3)) rint(3). round(0.5) 1.0 round(-0.5) -1.0. . x +0 -0 NaN x . . attributes(7). +------------+------------------------------------+--------------------+ || | | +------------+------------------------------------+--------------------+ |round(), | | MT-Safe | |roundf(), | | | |roundl() | | | +------------+------------------------------------+--------------------+ C11, POSIX.1-2008. glibc 2.1. C99 POSIX.1-2001. POSIX.1-2001 ( errno ERANGE FE_OVERFLOW). . ( . 32- 64- IEEE-754 127 (1023 ) 24 (53 ).) POSIX.1-2008. lround(3) . ceil(3), floor(3), lround(3), nearbyint(3), rint(3), trunc(3) 3 . . : . 6.18 8 2026 round(3)