I
illegal.prime
Hey all, I have an app, that could take two numbers of any type of
numerical type int, long, double, float, uint, ulong, etc. I want to
check that the numbers are part of a range that I consider "valid".
For my circumstances, I don't consider float.PositiveInfinity valid,
nor do I consider the two numbers valid if the second number is smaller
than the first. In other words, I want to check that the range is
valid.
I notice that while float and double have PositiveInfinity int does
not. Does int have no comparable concept? They obviously have
MaxValue and MinValue, but I'm looking for a concept similar to
positive or negative infinity.
In summary, I just want to make my valid range check code as robust and
thorough as possible.
Thanks,
Novice
numerical type int, long, double, float, uint, ulong, etc. I want to
check that the numbers are part of a range that I consider "valid".
For my circumstances, I don't consider float.PositiveInfinity valid,
nor do I consider the two numbers valid if the second number is smaller
than the first. In other words, I want to check that the range is
valid.
I notice that while float and double have PositiveInfinity int does
not. Does int have no comparable concept? They obviously have
MaxValue and MinValue, but I'm looking for a concept similar to
positive or negative infinity.
In summary, I just want to make my valid range check code as robust and
thorough as possible.
Thanks,
Novice