def valid_value?(v)
      v.respond_to?(:nan?) && v.nan? || v.nil? ? false : true
    end
def valid_value?(v)
      v.respond_to?(:nan?) && v.nan? || v.nil? ? false : true
    end
Helper method returning validity of arbitrary value