On Wednesday, July 22, 2015 11:32:19 PM Joe Tusek wrote:
> O.k., should I be writing all my Julia with variables defined as complex so
> as to avoid runtime assignment errors that may arise when outcomes of
> calculations result in complex numbers such as square roots of negative
> numbers or eigen values etc? Will there be a performance penalty coding
> this way?

Definitely. Multiplying 2 complex numbers is equivalent to 4 real multiplies 
and 2 real adds, so if you're interested in the utmost in performance you 
won't want to pay that penalty everywhere.

That said, you should only care about performance when it matters. Whenever 
the cost in programmer time exceeds the cost in run time, you are better off 
doing whatever you need to do to make things easy for yourself.

--Tim

Reply via email to