Class: Float

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

Overview

Patching Float with Algebra::Field compliance methods.

Class Method Summary collapse

Class Method Details

.add(other) ⇒ Object



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

def add( other ); self + other end

.additive_identityObject Also known as: zero



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

def additive_identity; 0.0 end

.additive_inverseObject



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

def additive_inverse; -self end

.multiplicative_identityObject Also known as: one



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

def multiplicative_identity; 1.0 end

.multiplicative_inverseObject



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