{"record":{"id":"f3fd77e8ea241bf0","repo":"RubyMoney/money","slug":"divided-by-zero","errorCode":null,"errorMessage":"divided by zero","messagePattern":"divided by zero","errorType":"exception","errorClass":"ZeroDivisionError","httpStatus":null,"severity":"error","filePath":"lib/money/money/arithmetic.rb","lineNumber":214,"sourceCode":"    #\n    # @return [Money] The resulting money if you divide Money by a number.\n    # @return [Float] The resulting number if you divide Money by a Money.\n    #\n    # @example\n    #   Money.new(100) / 10            #=> #<Money @fractional=10>\n    #   Money.new(100) / Money.new(10) #=> 10.0\n    #\n    def /(other)\n      if other.is_a?(self.class)\n        exchanged = other.exchange_to(currency)\n        raise ZeroDivisionError, \"divided by Money(0)\" if exchanged.zero?\n\n        fractional / as_d(exchanged.fractional).to_f\n      else\n        raise TypeError, \"Can not divide by Money\" if other.is_a?(CoercedNumeric)\n\n        other = as_d(other)\n        raise ZeroDivisionError, \"divided by zero\" if other.zero?\n\n        dup_with(fractional: fractional / other)\n      end\n    end\n\n    # Synonym for +#/+.\n    #\n    # @param [Money, Numeric] value Number to divide by.\n    #\n    # @return [Money] The resulting money if you divide Money by a number.\n    # @return [Float] The resulting number if you divide Money by a Money.\n    #\n    # @see #/\n    #\n    def div(value)\n      self / value\n    end\n","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/RubyMoney/money/blob/26e2829c34f165847040a5a40d4d2daa5eb72927/lib/money/money/arithmetic.rb#L196-L232","documentation":"Error \"divided by zero\" thrown in RubyMoney/money.","triggerScenarios":"Thrown at lib/money/money/arithmetic.rb:214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26e2829c34f165847040a5a40d4d2daa5eb72927","analyzedAt":"2026-08-23T17:41:07.306Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}