Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/fraction_tree/extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_nodeFractionTree::Node

Returns string Stern-Brocot decoded.

Examples:

Float::INFINITY.to_node => (1/0)

Returns:



26
27
28
# File 'lib/fraction_tree/extensions.rb', line 26

def to_node
  FractionTree.node(self)
end