: : : : : : : : : : : : : : :
#include<iostream>
#include<cmath>
using namespace std;
int main(){
cout<<"round(1.3) = "<<round(1.3)<<endl
<<"round(1.5) = "<<round(1.5)<<endl
<<"round(-1.3) = "<<round(-1.3)<<endl
<<"round(-1.5) = "<<round(-1.5)<<endl;
return 0;
}
this function takes the form of
double round(double d);
> > > > > > > > > > cmath>
Read More:
- C / C + + rounding function ceil(), floor ()
- C / C + + library function (tower / tower) realizes the conversion of letter case
- The use of C + + template function and lambda expression
- [C + +] C + + overload operator = must be a nonstatic member function?
- How to use C + + function pointer array
- error C4996: ‘scanf‘: This function or variable may be unsafe.Visual Studio Series compilers report errors using scanf function
- The difference of four kinds of integer function (fix floor ceil round) in MATLAB
- CIN in C + + cin.get ()、 cin.getline (), getline(), gets() function
- The function and usage of argc and argv in C language
- The C language qsort() function reports an error for overflow of – 2147483648 and 2147483648
- C++:error C2228: left of ‘.str’ must have class/struct/union
- Error c2064: term does not evaluate to a function in VC
- C language write() function analysis: write failed bad address
- C++: terminate called after throwing an instance of ‘std::length_error‘ (sort function cmp sorting rules problem)
- C language string processing error warning, c4996, sprintf, predicted, c4996, strcpy, c4996, strcat
- VS2010 library function problem: objidl. H (11266): error c2061: syntax error: identifier ‘__ RPC__ out_ xcount_ part’
- error C4996: ‘scanf’: This function or variable may be unsafe. Consider using scanf_s instead.
- error C2065: ‘cout’ : undeclared identifier
- Differences between length() size() and C strlen() of C + + string member functions