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



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

def add( other ); self + other end

.additive_identityObject Also known as: zero



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

def additive_identity; 0.0 end

.additive_inverseObject



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

def additive_inverse; -self end

.multiplicative_identityObject Also known as: one



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

def multiplicative_identity; 1.0 end

.multiplicative_inverseObject



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

def multiplicative_inverse; 1.0 / self end

.multiply(other) ⇒ Object



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

def multiply( other ); self * other end