# nearbyint(3) [osx man page]

```NEARBYINT(3)						   BSD Library Functions Manual 					      NEARBYINT(3)

NAME
nearbyint -- round to integral value in floating-point format

SYNOPSIS
#include <math.h>

double
nearbyint(double x);

long double
nearbyintl(long double x);

float
nearbyintf(float x);

DESCRIPTION
The nearbyint() functions return the integral value (represented as a double precision number) nearest to x according to the prevailing
rounding mode.

nearbyint() is the same as rint(), except that nearbyint is guaranteed never to set floating point flags or trigger floating point exceptions
(which are disabled by default).  rint() is typically much more performant than nearbyint() if the application does not depend on flags being
preserved.

SPECIAL VALUES
nearbyint(+-0) returns +-0 for all rounding modes.

nearbyint(+-infinity) returns +-infinity for all rounding modes.

rint(3) ceil(3) floor(3) round(3) trunc(3) lround(3) lrint(3) llround(3) llrint(3) math(3)

STANDARDS
The nearbyint() functions conform to ISO/IEC 9899:2011.

BSD								   July 01, 2008							       BSD```

## Check Out this Related Man Page

```RINT(3) 						   BSD Library Functions Manual 						   RINT(3)

NAME
nearbyint, nearbyintf, nearbyintl, rint, rintf, rintl -- round to integral value in floating-point format

LIBRARY
Math Library (libm, -lm)

SYNOPSIS
#include <math.h>

double
nearbyint(double x);

float
nearbyintf(float x);

long double
nearbyintl(long double x);

double
rint(double x);

float
rintf(float x);

long double
rintl(long double x);

DESCRIPTION
The rint(), rintf(), and rintl() functions return the integral value nearest to x according to the prevailing rounding mode.  These functions
raise an inexact exception when the original argument is not an exact integer.

The nearbyint(), nearbyintf(), and nearbyintl() functions perform the same operation, except that they do not raise an inexact exception.

abs(3), ceil(3), fabs(3), fenv(3), floor(3), ieee(3), lrint(3), lround(3), math(3), round(3)

STANDARDS
These functions conform to ISO/IEC 9899:1999 (``ISO C99'').

HISTORY
A rint() function appeared in Version 6 AT&T UNIX.  The nearbyint() and nearbyintf() functions appeared in FreeBSD 5.3, and the long double
variants were first available in FreeBSD 8.0.

BSD								 January 13, 2008							       BSD```
Man Page