Wednesday, April 29, 2009

rounding in C++

is done as follows:

#include

double d = floor(num+.5);


This is just one of the ways.

No comments: