Skip to content

Commit

Permalink
Spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
douglascodes committed Mar 12, 2013
1 parent 5267a5c commit 3af7cbe
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/radix/numeric.rb
Expand Up @@ -81,25 +81,30 @@ def parse_base(base)
end

##
# Simply returns the passed value. Used for simplifying creation of Radix
# instances.
# Simply returns the passed value. Used for simplifying creation of
# Radix::Numeric instances.
#
# @param [Radix::Float, Radix::Integer] value Given value.
# @param [String, Array, Numeric] base Desired base.
# @return [Radix::Float, Radix::Integer] The passed value.
def parse_numeric(value, base)
value
end

##
# If a float style string is passed in for +value+, e.g. "9.5", the
# decimal will simply be truncated. So "9.x" would become "9".
#
# @param [Radix::Float, Radix::Integer] value Given value.
# @param [String, Array, Numeric] base Desired base.
# @return [Radix::Float, Radix::Integer] The passed value.
def parse_string(value, base)
digits = value.split(//)
parse_array(digits, base)
end

# Take an Array in the form of [d1, d2, ..., DOT, d-1, d-2, ...]
# and convert it to base ten, and store in @value.

def parse_array(value, base)
value = value.dup

Expand Down

0 comments on commit 3af7cbe

Please sign in to comment.