C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C++ Math floor()It rounds the value to the nearest integer which is not greater than the given value. For example: floor(8.2)=8.0; floor(-8.8)=-9.0; SyntaxSuppose a number is 'x'. Syntax would be : double floor(double x); Parameterx : It is the value that rounds to the nearest integer. Return valueIt returns the value that round to the nearest integer not greater than x. Example 1Let's see a simple example by considering a positive value. #include Output: Initial value of x is : 7.8 Now, the value of x is :7 Example 2Let's see a simple example by considering a negative value. #include Output: Initial value of x is : -10.2 Now, the value of x is :-11
Next TopicC++ Math Functions
|