Module: MathSymbols::MathExtensions

Included in:
Math, Object
Defined in:
lib/math_symbols/math_extensions.rb

Instance Method Summary collapse

Instance Method Details

#Γ(value) ⇒ Object



19
20
21
# File 'lib/math_symbols/math_extensions.rb', line 19

def Γ(value)
  Math.gamma value
end

#δ(value) ⇒ Object



31
32
33
# File 'lib/math_symbols/math_extensions.rb', line 31

def δ(value)
  value.zero? ?  : 0
end

#πObject



23
24
25
# File 'lib/math_symbols/math_extensions.rb', line 23

def π
  Math::PI
end

#(enumerable) ⇒ Object



9
10
11
12
13
# File 'lib/math_symbols/math_extensions.rb', line 9

def (enumerable)
  enumerable.inject 1 do |acc, x|
    acc * yield(x)
  end
end

#(enumerable) ⇒ Object



3
4
5
6
7
# File 'lib/math_symbols/math_extensions.rb', line 3

def (enumerable)
  enumerable.inject 0 do |acc, x|
    acc + yield(x)
  end
end

#(value) ⇒ Object



15
16
17
# File 'lib/math_symbols/math_extensions.rb', line 15

def (value)
  Math.sqrt value
end

#Object



27
28
29
# File 'lib/math_symbols/math_extensions.rb', line 27

def 
  Float::INFINITY
end