C++ Math nearbyint()
The function rounds off the given value to a nearby integral value by using the current rounding method. The current rounding method is described by fegetround.
Suppose a number is 'x'. Syntax would be:
Note: The return_type can be float, double or long double.
x: The value can be float or double.
It returns the rounded value of x to a nearby integral value by using the rounding method.
Let's see a simple example.
Value of x is:2.3 Rounding to nearby,value is :2
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week