Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have an expression:
if A≤X1-X2≤B, than Y=1, Otherwise Y=0
where A and B are constants, and X1, X2 are variables.
Please help to convert this to linear expressions.