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. SyntaxSuppose a number is 'x'. Syntax would be: Note: The return_type can be float, double or long double.Parameterx: The value can be float or double. Return valueIt returns the rounded value of x to a nearby integral value by using the rounding method. Example 1Let's see a simple example. Output: Value of x is:2.3 Rounding to nearby,value is :2 Next TopicC++ Math Functions |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India