Class: Integer

Inherits:
Object show all
Defined in:
lib/y_support/abstract_algebra.rb

Overview

Patching Integer with Algebra::Ring compliance methods.

Class Method Summary collapse

Class Method Details

.add(other) ⇒ Object



86
# File 'lib/y_support/abstract_algebra.rb', line 86

def add( other ); self + other end

.additive_identityObject Also known as: zero



84
# File 'lib/y_support/abstract_algebra.rb', line 84

def additive_identity; 0 end

.additive_inverseObject



87
# File 'lib/y_support/abstract_algebra.rb', line 87

def additive_inverse; -self end

.multiplicative_identityObject



89
# File 'lib/y_support/abstract_algebra.rb', line 89

def multiplicative_identity; 1 end

.multiply(other) ⇒ Object



88
# File 'lib/y_support/abstract_algebra.rb', line 88

def multiply( other ); self * other end