Sha256: 8426c133beb65df4d05907b903fcb494a8949a0e20973b4006208960e9aa53b4

Contents?: true

Size: 346 Bytes

Versions: 5

Compression:

Stored size: 346 Bytes

Contents

module Dydx
  class Delta
    attr_accessor :var, :function
    def initialize(var = nil, function = nil)
      @var      = var
      @function = function
    end

    def /(delta)
      if var
        eval("$#{var}").differentiate(delta.var)
      elsif delta.function
        delta.function.differentiate(delta.var)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dydx-0.2.7000001 lib/dydx/delta.rb
dydx-0.2.7000000 lib/dydx/delta.rb
dydx-0.1.41421 lib/dydx/delta.rb
dydx-0.1.412 lib/dydx/delta.rb
dydx-0.1.4 lib/dydx/delta.rb