Help get this topic noticed by sharing it on Twitter, Facebook, or email.

unsigned INT

Well, that's what I want. Basically I need to store a small positive integer and when calculating, to ensure it never becomes negative. So 0 would be the minimum value. But we have no max() function and no apparent hope of ever seeing one. So can anyone suggest how to do simple addition/subtraction but ensure it never goes below 0 and without using a conditional structure?

Not the ideal solution, but conditionals could be used, except when this is all taking place already inside a conditional because as we know, iRule doesn't allow nested conditionals.

So I'm looking for a mathematical construct that could be used in a variable expression calculation as an equivalent to max(0,$somevariable$-1). Anyone?
1 person has
this question
+1
Reply