Sha256: 0c877ead18714bc326a2a3e578cb078f0f32efbbb294897cb3f1e88c5ca7d2fc
Contents?: true
Size: 1.52 KB
Versions: 4
Compression:
Stored size: 1.52 KB
Contents
# encoding: utf-8 module Veritas class Function class Numeric # A class representing a exponentiation function class Exponentiation < Numeric include Binary, Binary::Invertible, Comparable # Return the Exponentiation operation # # @example # Exponentiation.operation # => :** # # @return [Symbol] # # @api public def self.operation :** end # Return the inverse function # # @example # inverse = exponentiation.inverse # # @return [Exponentiation] # # @api public def inverse self.class.new(left, Division.new(1, right)). memoize(:inverse, self) end module Methods extend Aliasable inheritable_alias( :** => :exponent, :pow => :exponent ) # Return an exponential function # # @example # exponentiation = attribute.exponent(other) # # @param [Object] other # # @return [Exponentiation] # # @api public def exponent(other) Exponentiation.new(self, other) end end # module Methods Attribute::Numeric.class_eval { include Methods } Numeric.class_eval { include Methods } memoize :inverse end # class Exponentiation end # class Numeric end # class Function end # module Veritas
Version data entries
4 entries across 4 versions & 1 rubygems