Looking for change in specific range


    Mar 08 2012 | 3:37 am
    I get an incoming value x between 0. and 1. and want to trigger specific actions if a new range (f.e 0.25 - 0.5) is entered:
    x < 0.02: 0;
    x > 0.02 && x x > 0.25 && x x > 0.5 && x x > 0.75 && x x > 0.98: 0;
    While my solution is working (see attached patch) I am sure that there should be more elegant solutions....

    • Mar 08 2012 | 3:50 am
      I might use split for this.
    • Mar 08 2012 | 4:12 am
      Yeah, that's much better!
      Thanks!
    • Mar 08 2012 | 7:14 am
      Hi,
      let me take the opportunity for some self-promotion and let you suggest to try my [sadam.split] object for this. Using that object, you won't need cascaded splits, instead, you would have a single one with multiple limits.
      Available in The sadam Library here: http://www.sadam.hu/software
      Best,
      Ádám
    • Mar 08 2012 | 8:56 am
      For these kinds of problems also simple math will do.
    • Mar 08 2012 | 9:03 am
      ha, that's cool! @jvkr