I\'m looking for a fluent way of determining if a number falls within a specified set of ranges. My current code looks something like this:
int x = 500; // Could
I personally prefer the extension method suggested by @Anton - but if you can't do that, and are going to stick with your current code, I think you could make it more readable by reversing the first set of conditions on each line as follows...
int x = 500; // Could be any number
if ( ( 4199 < x && x < 6800 ) ||
( 6999 < x && x < 8200 ) ||
( 9999 < x && x < 10100 ) ||
( 10999 < x && x < 11100 ) ||
( 11999 < x && x < 12100 ) )
{
// More awesome code
}