asbo Posted April 25, 2009 Report Share Posted April 25, 2009 I looked around and was surprised to find this hasn't been mentioned anywhere. By default, you can create numeric ranges by setting the case to be, say, "..0" to include zero and any number less than zero. I think it'd be handy to have exclusive ranges as well. Yes, there was always alternate ways to implement the logic, but that can get messy. Can't come up with any good notation for it, though. Maybe "1.,10" is the same as [1,10)? Quote Link to comment
crossrulz Posted April 25, 2009 Report Share Posted April 25, 2009 QUOTE (asbo @ Apr 24 2009, 11:35 AM) I looked around and was surprised to find this hasn't been mentioned anywhere. By default, you can create numeric ranges by setting the case to be, say, "..0" to include zero and any number less than zero. I think it'd be handy to have exclusive ranges as well. Yes, there was always alternate ways to implement the logic, but that can get messy. Can't come up with any good notation for it, though. Maybe "1.,10" is the same as [1,10)? You mean like this: Already in there. Darren had a nugget about these case structures here. Check it out. There's lots of good info in it. EDIT: I just figured out that you didn't want to include the 10 in that case :headbang: . That would be interesting. But the case structure can't handle floating points, so therefore you would have to use "1..9". Quote Link to comment
asbo Posted April 25, 2009 Author Report Share Posted April 25, 2009 I see what you mean about the floating point; I suppose it would only really be useful for cases involving zero and having a floating point input. For example, (-inf,0] and (0,inf) - the second case would exclude zero - with an input of 0.01. Since it has to be typecast to be used by the case statement, will it be coerced to 0 or to 1? Obviously, my intention would be that it be coerced to 1. Maybe I should just change the suggestion to be "Use floating point in Case Statements" Quote Link to comment
ShaunR Posted April 25, 2009 Report Share Posted April 25, 2009 I'd like to be able to use "<" (less than) or ">" (greater than). Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.