Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/numeric_inverse/ext/numeric.rb

Direct Known Subclasses

Integer

Instance Method Summary collapse

Instance Method Details

#inverseNumeric Also known as: inv

Returns its inverse.

Examples:

Rational(7, 22).inv   #=> (22/7)
Integer(16).inv       #=> (1/16)
Float(16).inv         #=> 0.0625
Complex(3, 4).inv     #=> ((3/25)-(4/25)*i)

Returns:



13
14
15
# File 'lib/numeric_inverse/ext/numeric.rb', line 13

def inverse
	1.quo(self)
end