   private func floorDiv(_ x: Expr, _ y: Expr) throws -> Expr {
     switch try NumberPair(x, y) {
       case .fixnumPair(let lhs, let rhs):
+        guard rhs != 0 else {
+          throw RuntimeError.eval(.divisionByZero)
+        }
         let res = lhs % rhs
         if (res < 0) == (rhs < 0) {
           return .values(.pair(.makeNumber((lhs - res) / rhs), .pair(.makeNumber(res), .null)))

                               .pair(.makeNumber(res + rhs), .null)))
        }
      case .bignumPair(let lhs, let rhs):
        let res = lhs % rhs
        if res.isNegative == rhs.isNegative {
          return .values(.pair(.makeNumber((lhs - res) / rhs), .pair(.makeNumber(res), .null)))

  private func truncateRemainder(_ x: Expr, _ y: Expr) throws -> Expr {
    switch try NumberPair(x, y) {
      case .fixnumPair(let lhs, let rhs):
        guard rhs != 0 else {
          throw RuntimeError.eval(.divisionByZero)
        }
        return .makeNumber(lhs % rhs)
      case .bignumPair(let lhs, let rhs):
        guard !rhs.isZero else {
          throw RuntimeError.eval(.divisionByZero)
        }
        return .makeNumber(lhs % rhs)
      case .flonumPair(let lhs, let rhs):
        guard Foundation.trunc(lhs) == lhs else {
