Forum Discussion

Stefan_Loeve_16's avatar
Stefan_Loeve_16
Icon for Nimbostratus rankNimbostratus
Aug 19, 2014

Negative integers, and how to handle them

Hi DevCentral. Im trying to write an iRule that takes an integer from HTTP headers, and use comparisons to determine a node to send to. Our current method works when our integer is a positive number, however when the integer is returned as a negative value, the 'if' statement doesn't match.

 

Do we need to find a way to cast the integer? Or are we going to have to try and use regex on the binary/hex values?

 

Any ideas would be greatly appreciated. Thanks, Stefan

 

1 Reply

  • I forgot to include a sample of the iRule that I am trying to work with: if { $HeaderVAR < -1342177280 and $HeaderVAR > -1073741824 } { node x.x.x.x 80