C++ (Qt)double x=123.56;int y=x; // y= 123
double d = 40.6;if (d > floor(d)+0.5) d = ceil(d); else d = floor(d);
double round(double Number){ bool Negative = Number < 0 ? true: false; Number = fabs(Number); if (Number > floor(Number)+0.5) Number = ceil(Number); else Number = floor(Number); return Negative ? Number * (-1) : Number;}
C++ (Qt)double round (double d){ return floor (d + 0.5);}
double fractional(double Number){ return Number < 0 ? Number - ceil(Number) : Number - floor(Number);}double integer(double Number){ return Number < 0 ? ceil(Number) : floor(Number);}
double d2=4.6; d2=modf(d2,NULL);