I've been thinking, but I can't figure out how to get a boolean expression (specifically "X>=S and X<=T") to evaluate to 1 if true and -1 if false (this has to be in a function, so I can't write 'if' statements to do it). How can it be done?
you can do -(-1^(X>=S and X<=T)). true will be -(-1) = 1 and false will be -(1)
Visit Calccrypto for info on crypto
another one could be -1+2(X>=S and X<=t) it uses less memory and less intensive math, so is slightly faster as well.