Sha256: 413157089c24736c0fd7892c475159bb4b9284b2e8211b69ad7faea33556683c
Contents?: true
Size: 651 Bytes
Versions: 11
Compression:
Stored size: 651 Bytes
Contents
module Dydx module Algebra module Operator module Parts module Inverse %w(+ * ^).map(&:to_sym).each do |operator| define_method(operator) do |x| if inverse?(operator, x) case operator when :+ then e0 when :* then e1 end elsif !x.is_a?(Inverse) && operator == :+ x + self elsif self.operator == :* && operator == :^ inverse(self.x ^ x, :*) else super(x) end end end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems