Sha256: e6f964a6bcab639231716a426e13d86db147ffb6af5bd59f2b4b5f9b5e3687c5

Contents?: true

Size: 342 Bytes

Versions: 9

Compression:

Stored size: 342 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

9 entries across 9 versions & 1 rubygems

Version Path
dydx-0.1.314 lib/dydx/delta.rb
dydx-0.1.31 lib/dydx/delta.rb
dydx-0.1.3 lib/dydx/delta.rb
dydx-0.1.29 lib/dydx/delta.rb
dydx-0.1.28 lib/dydx/delta.rb
dydx-0.1.25 lib/dydx/delta.rb
dydx-0.1.2 lib/dydx/delta.rb
dydx-0.1.1 lib/dydx/delta.rb
dydx-0.1.0 lib/dydx/delta.rb