Class: Float
Overview
Patching Float with Algebra::Field compliance methods.
Class Method Summary collapse
- .add(other) ⇒ Object
- .additive_identity ⇒ Object (also: zero)
- .additive_inverse ⇒ Object
- .multiplicative_identity ⇒ Object (also: one)
- .multiplicative_inverse ⇒ Object
- .multiply(other) ⇒ Object
Class Method Details
.add(other) ⇒ Object
97 |
# File 'lib/y_support/abstract_algebra.rb', line 97 def add( other ); self + other end |
.additive_identity ⇒ Object Also known as: zero
95 |
# File 'lib/y_support/abstract_algebra.rb', line 95 def additive_identity; 0.0 end |
.additive_inverse ⇒ Object
98 |
# File 'lib/y_support/abstract_algebra.rb', line 98 def additive_inverse; -self end |
.multiplicative_identity ⇒ Object Also known as: one
100 |
# File 'lib/y_support/abstract_algebra.rb', line 100 def multiplicative_identity; 1.0 end |
.multiplicative_inverse ⇒ Object
102 |
# File 'lib/y_support/abstract_algebra.rb', line 102 def multiplicative_inverse; 1.0 / self end |
.multiply(other) ⇒ Object
99 |
# File 'lib/y_support/abstract_algebra.rb', line 99 def multiply( other ); self * other end |