I searched around and couldn\'t find the trunc function for C++. I know I can do this:
trunc
int main() { double a = 12.566789; cout <<
If your C library is so old that it lacks a trunc function (specified in C99), you can easily implement one based on floor and ceil (specified in C89)
floor
ceil
double trunc(double d){ return (d>0) ? floor(d) : ceil(d) ; }