title: Spark - Reduce with division operator
body: <p>I have 2 sets, one with positive and one with negative samples. First value in array is item identification, second value refers to sum of such items.</p>
  
  <pre><code>positive: Array[(String, Int)]
  
  negative: Array[(String, Int)]
  </code></pre>
  
  <p>I would like to construct array result, which will contain item name and its positive to negative ratio as float number. The command below returns me only integer ratio.</p>
  
  <pre><code>val result = positive.union(negativeCount).reduceByKey((a, b) =&gt; (a / b)
  </code></pre>
  
  <p>Can you please advice how to make the ratio a float number?</p>
  
  <p>Thanks.</p>