Add a `clamp` function to Algorithm.swift

Great idea, I have created a separate pitch: ClosedRange init with unordered bounds