class Dentaku::AST::Division

Public Class Methods

precedence() click to toggle source
# File lib/dentaku/ast/arithmetic.rb, line 175
def self.precedence
  20
end

Public Instance Methods

operator() click to toggle source
# File lib/dentaku/ast/arithmetic.rb, line 164
def operator
  :/
end
value(context = {}) click to toggle source
# File lib/dentaku/ast/arithmetic.rb, line 168
def value(context = {})
  r = decimal(cast(right.value(context)))
  raise Dentaku::ZeroDivisionError if r.zero?

  cast(cast(left.value(context)) / r)
end