take infinities into account