#include <iostream>
#include <cmath>
using std::cout;
using std::endl;
void testRounding(double value)
{
cout << "Gleitkommazahl: " << value << endl;
cout << "cast: " << int(value + 0.5) << endl;
cout << "cast': "<< int(value < 0.0 ? value - 0.5 : value + 0.5) << endl;
cout << "round: " << round(value) << endl;
cout << "floor: " << floor(value) << endl;
cout << "ceil: " << ceil(value) << endl;
cout << "trunc: " << trunc(value) << endl << endl;
}
int main()
{
testRounding(1.2);
testRounding(2.5);
testRounding(3.7);
testRounding(-0.6);
return 0;
}