C++ Math lrint()The function rounds off the given value using current rounding mode and returns the value of type long int. SyntaxSuppose a number is 'x'. Syntax would be: Parameterx: The value that can be float, double or long double. Return valueIt returns the rounded value of x and the return type of the value is long int. Example 1Let's see a simple example. Output: Enter the value which you want to round : 7.8 Name of the methods are : 1. Rounding downwards 2. Rounding upwards 3. Rounding towards zero 4. Rounding to the nearest Enter the number of rounding method : 1 Rounding downwards,value is :7
Next TopicC++ Math Functions
|
JavaTpoint offers too many high quality services. Mail us on h[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