We might consider `from __future__ import division` at the top instead of explicit casting here.