That was an incomplete (pre-coffee) answer.

The equations are still well behaved for vertical segments.  When slope is +/- `Infinity`, then the intersection x-offset will be `0` (`dy / Infinity === 0`).

And similarly for horizontal segments.  When slope is `0` then the intersection y-offset will be zero (`dx * 0` in this case).

The tests cover [both](https://github.com/openlayers/ol3/pull/1754/files#diff-0c5ae6d3103df4bd73579a01f2093aedR366) of [these](https://github.com/openlayers/ol3/pull/1754/files#diff-0c5ae6d3103df4bd73579a01f2093aedR381) cases.