title: Using asInstanceOf to convert Any to Double
body: <p>I have a function that takes a variable number of arguments.  The first is a String and the rest are numbers (either Int or Double) so I am using Any* to get the arguments.  I would like to treat the numbers uniformly as Doubles, but I cannot just use asInstanceOf[Double] on the numeric arguments.  For example:</p>
  
  <pre><code> val arr = Array("varargs list of numbers", 3, 4.2, 5)
   val d = arr(1).asInstanceOf[Double]
  </code></pre>
  
  <p>gives:</p>
  
  <pre><code> java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Double
  </code></pre>
  
  <p>Is there a way to do this?  (The function needs to add up all the numbers).</p>