Task

Write a function to detect a   divide by zero error   without checking if the denominator is zero.




def divide(numerator, denominator) {
    def floatQuotient := numerator / denominator
    if (floatQuotient.isNaN() || floatQuotient.isInfinite()) {
        return ["zero denominator"]
    } else {
        return ["ok", floatQuotient]
    }
}