Should throw out of range exception when stackoverflow. division by 0 should throw our of range exception. Imported from Jira [BEAM-8064](https://issues.apache.org/jira/browse/BEAM-8064). Original Jira may contain additional context. Reported by: amaliujia.