added castDouble() to header; used castDouble() to remove tmp var 'r'

castDouble takes a string and uses lexical_cast from Boost to
return a double.  this replaced multiple occurences of the
temporary variable 'r' which was then being passed to resultOut()