module Kernel

Extend the core Kernel module

Constants

NOTATION_VERSION

Version of the notation library

Public Instance Methods

(*args) click to toggle source

Pi product, i.e. the product of all elements.

Example:

 [2,3,4] => 24
# File lib/notation.rb, line 29
def (*args)
  args.inject(1){ |e, m| m * e }
end
(*args) click to toggle source

Sigma, i.e. the sum of all elements.

Example:

 [1,2,3] => 6
# File lib/notation.rb, line 20
def (*args)
  args.inject(0){ |e, m| m + e }
end
(root) click to toggle source

Square root

Example:

 49 => 7.0
# File lib/notation.rb, line 38
def (root)
  Math.sqrt(root)
end