Over the new year holiday I wrote a rational number in Java just for lulz. I was looking at it the other night and thought of a way to make the code for rounding to an integer more elegant using a
There’s a bit of code that’s computationally expensive that I don’t need to do unless the RoundingMode is one of HALF_UP, HALF_DOWN or HALF_EVEN; so I’m wondering whether
Another important question: do I really care, or am I just engaging in premature optimization? 😎
Here’s a screenshot of a bit of WinDiff output to show what I’m thinking of: