step_interp_factory function

A factory that returns a function that performs linear interpolation, allowing for "steps" or discontinuities.