lib/dydx/function.rb in dydx-0.1.41421 vs lib/dydx/function.rb in dydx-0.2.7000000
- old
+ new
@@ -8,9 +8,18 @@
def <=(algebra)
@algebra = algebra
self
end
+ def evalue(nums)
+ subst_hash = Hash[*[@vars, nums].transpose.flatten]
+ begin
+ @algebra.subst(subst_hash).to_f
+ rescue ArgumentError
+ eval(@algebra.subst(subst_hash).to_s)
+ end
+ end
+
def differentiate(sym = :x)
@algebra.differentiate(sym)
end
alias_method :d, :differentiate