Class: Integer
Overview
Patching Integer with Algebra::Ring compliance methods.
Class Method Summary collapse
- .add(other) ⇒ Object
- .additive_identity ⇒ Object (also: zero)
- .additive_inverse ⇒ Object
- .multiplicative_identity ⇒ Object
- .multiply(other) ⇒ Object
Class Method Details
.add(other) ⇒ Object
86 |
# File 'lib/y_support/abstract_algebra.rb', line 86 def add( other ); self + other end |
.additive_identity ⇒ Object Also known as: zero
84 |
# File 'lib/y_support/abstract_algebra.rb', line 84 def additive_identity; 0 end |
.additive_inverse ⇒ Object
87 |
# File 'lib/y_support/abstract_algebra.rb', line 87 def additive_inverse; -self end |
.multiplicative_identity ⇒ Object
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 |