<cmath> is described in the C++ standard (which means C++ compilers and libraries support it). The std::nint() function is declared in that header. Alternatively, you can use the <math.h> header from C (which C++ is backward compatible to) and the nint() function in that.
If you have a help file with your compiler, you will usually find the standard library described in that. Otherwise, most basic texts will give you an introduction to functions in the standard library: so look up nint() in the index of such books.
In this case, nint() is a function of the prototype "int nint(double);" or something equivalent for your compiler. The only difference is that the version in <cmath> is placed in namespace std, and the one in <math.h> is not. Those headers provide a number of basic mathematical functions.
Just in case the following doesn't help, here's are three examples of usage (all equivalent, in terms of results).
Code:
// The standard C++ way #1
#include <cmath>
int main()
{
double x = 2.7;
int i = std::nint(x); // i will have a value of 3
return 0;
}
or
Code:
// The standard C++ way #2
#include <cmath>
using namespace std; // Use this with caution; there are some traps
int main()
{
double x = 2.7;
int i = nint(x); // i will have a value of 3
return 0;
}
or
Code:
/* A standard C way. C++ supports this, but it is often considered bad style in C++ */
#include <math.h>
int main()
{
double x = 2.7;
int i = nint(x); // i will have a value of 3
return 0;
}