I suppose it depends on your desired output.
#include <iostream>
void foo(double value)
{
int trunc = int(value);
std::cout << "value = " << value << ", trunc = " << trunc << "\n";
}
int main(void)
{
foo(4.123999);
foo(4.823999);
foo(-4.123999);
foo(-4.823999);
return 0;
}
/* my output
value = 4.124, trunc = 4
value = 4.824, trunc = 4
value = -4.124, trunc = -4
value = -4.824, trunc = -4
*/
If you felt that one of the results should have been 5 or -5, then truncation is not what you want. Thus the other options.
Also, you are going to run into issues if the double value is outside of the range of a int.