C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C++ Math rint()The function rounds off the given value to the nearest integer using current rounding mode. The current rounding mode is determined by fesetround(). For example: rint(7.9) = 8; if, fesetround(FE_DOWNWARD) then, rint(7.9) = 7; SyntaxSuppose a number 'x'. Syntax would be: return_type rint(data_type x); Note: The return_type can be float, double or long double.Parameterx: The value that can be either float or double. Return valueIt returns the rounded value of x. Example 1Let's see a simple example. #include Output: Value of x is :9.9 Rounding to nearest,value is :10 Rounding to upward,value is :10 Rounding to downward,value is :9
Next TopicC++ Math Functions
|