SyntaxFix
Write A Post
Hire A Developer
Questions
You can also use function:
//Works with negative numbers now static int MyRound(double d) { if (d < 0) { return (int)(d - 0.5); } return (int)(d + 0.5); }
Depending on the architecture it is several times faster.