I was just wondering why DateTime.DaysInMonth(int, int) returns an int instead of a ushort? I mean at worst it's 31 (for what the ushort is enough).
What am I missing?
I was just wondering why DateTime.DaysInMonth(int, int) returns an int instead of a ushort? I mean at worst it's 31 (for what the ushort is enough).
What am I missing?
int operations. That might be one of the reasons why operator overloads like +(byte, byte) or +(short, short) return an int and not a byte or short. Its arguable this is the only reason, consistent behavior with previous languages being another. You can check out this question for more details.