long int lround(double x);
lround rounds x to an integral value, with halfway cases rounded away from zero, and returns it as a long int.