Top Level Namespace

Defined Under Namespace

Modules: RationalNumberGem Classes: NoParentRationalNumberIsRootError, RationalNumber, RationalNumberIsRootNoSiblingsError

Instance Method Summary collapse

Instance Method Details

#bigdecimalObject

Rational Numbers (tree) in ruby

Read about rational numbers in tree structures here: arxiv.org/pdf/0806.3115v1.pdf

Please note that sibling and child will be identical if you are start at “root” level, with the default values (nv = 0, dv = 1, snv = 1, sdv = 0)

Rational numbers always require a “root” at the bottom of the tree

You can find child values, sibling values, see if a value is parent or child of a given rational number. It is possible to verify child/parent relationships without even checking with a database.



15
# File 'lib/rational_number.rb', line 15

require 'bigdecimal'