Perspective Scroll Wheel Zoom freezes

I’ve managed to get the scroll wheel to zoom the camera in by changing the perspective, the problem I’m having is when it zooms in or out to the maximum distance I’ve allowed it freezes the scrolling zoom and I can’t zoom in or out anymore.

	
    if (Input.GetAxis("Mouse ScrollWheel") < 0) {
    		if ((camera.fieldOfView > minZoom) && (camera.fieldOfView < maxZoom)) {
    			camera.fieldOfView = camera.fieldOfView + zoomSpeed;
    		}
    	}
    	
    	//This is for zooming out with the camera.
    	if (Input.GetAxis("Mouse ScrollWheel") > 0) {
    		if ((camera.fieldOfView > minZoom) && (camera.fieldOfView < maxZoom)) {
    			camera.fieldOfView = camera.fieldOfView - zoomSpeed;
    		}
    	}
 

As you’re dealing with floats, it’s probably a matter of precision. What happens if the perspective is greater than maxZoom? There’s no way to get it back down.
So instead of if statement, why not try using Mathf.Clamp() to keep the perspective in check?

Something like this maybe (c#):

camera.fieldOfView += Input.GetAxis("Mouse ScrollWheel");
camera.fieldOfView = Mathf.Clamp(camera.fieldOfView, minZoom, maxZoom);