title: Certain mathematical equations run on arrays in Ruby return single digits when double digits expected
body: <p>My calculator correctly subtracts and divides, but cannot correctly add or multiply correctly when there is a number that is multi-digit. Whenever I use such a number, it cuts off the last digit of the multi-digit number. For example, 12*2 becomes 2, 10*10 becomes 1, and so on.
  Updated to include init method</p>
  
  <pre class="lang-rb prettyprint-override"><code>class Sci_Calc
      def self.init
          puts "Which function of this calculator would you like to use? "
          calc_fun = gets.chomp
          case calc_fun
          when "sub"
              self.sub
          when "add"
              self.add(gets.chomp.split("").map(&amp;:to_i))
          when "mult"
              self.mult(gets.chomp.split("").map(&amp;:to_i))
          when div
              self.div
          end
      end
      def self.sub()
          puts "Please put the number you would like to sub from first. "
          num1 = gets.chomp.to_i
          puts "Second number: "
          num2 = gets.chomp.to_i
          num3 = num1 - num2
          puts num3
          self.init
      end
      #For now, it can only add 1 digit numbers
      def self.add(num_array)
          sum=0;
          sum=num_array.sum
          puts sum
          self.init
      end
      #code taken from https://stackoverflow.com/questions/7050869/ruby-multiply-all-elements-of-an-array
      def self.mult(mult_array)
          #Take each element in the array, and add it together.
          result = 1
          mult_array.each do |i|
              #Ignores zeroes in array.
              if i!=0
                  result = result*i
              else
                  result
              end
          end
          puts result
      end
      def self.div
          puts "Pick the number you would like to divide from first: "
          div1 = gets.chomp.to_i
          puts "Second number, please: "
          div2 = gets.chomp.to_i
          puts "Result is: "
          div3 = div1/div2
          puts div3
      end
  end
  Sci_Calc.init
  </code></pre>
  
  <p>I will gladly put the rest of the code into a pastebin if needed to answer this question.</p>