Actually clamp() would be more suitable, to set a min and a max.
In the previously mentioned example capx, the zoom amount is set with the action
Set Layout Scale to InitialScale * (TouchCurrentDistance / TouchStartDistance)
You would instead set it to clamp(InitialScale * (TouchCurrentDistance / TouchStartDistance),minscalefactor,maxscalefactor)
Where min and max scalefactor would be the limits of how much you want to zoom.