In [animation nodes] there is one.
However in texture / material / compositor the only way is to hack it. I remembered trying something that sometime ago and then some solution with a simple node group. Perhaps now it would be a great opportunity to popularize the idea once again and get a jucy boolean node in the Math category.