>>svanta+a2
Yeah, seems reasonable. I think the outer call wins, so min(max()) will always return lo for empty intervals, right? I didn’t know std::clamp() was undefined for empty intervals. It does seem like a good idea to try to guarantee the interval is valid instead of worrying about clamp… even with a guarantee, the answer might still surprise someone, since technically the problem is mathematically undefined and the guaranteed answer is wrong.