Let epsilon = min(x-a, b-x)

Randi Bolt

2021/11/16