Class: Keisan::Functions::Reduce

Inherits:
EnumerableFunction show all
Defined in:
lib/keisan/functions/reduce.rb

Instance Attribute Summary

Attributes inherited from Keisan::Function

#arity, #name

Instance Method Summary collapse

Methods inherited from EnumerableFunction

#evaluate, #simplify, #unbound_variables, #value

Methods inherited from Keisan::Function

#differentiate, #evaluate, #simplify, #unbound_variables, #value

Constructor Details

#initializeReduce

Reduces (list, initial, accumulator, variable, expression) e.g. reduce(, 0, total, x, total+x) should give 10 When hash: (hash, initial, accumulator, key, value, expression)



10
11
12
# File 'lib/keisan/functions/reduce.rb', line 10

def initialize
  super("reduce")
end