Re: cmplx(0.,-x) or -j*x



gh14tq5@xxxxxxxxx writes: > Hi,
>
> Is there any speed advantage of using
>
> z = cmplx(0,-x) over z = -j*x (or vice-versa)
>
> where x is real and possible an array and j=sqrt(-1). Would this be
> something that is compiler dependent?

Isn't J going to be complex?
And therefore j*x is going to involve scalar multiplication
twice (j*0 and j*x).
This will be somewhat longer than using cmplx,
which just does two moves (0 into the real part and
-x to the unreal part).

> Thanks,
> John
.



Relevant Pages

  • cmplx(0.,-x) or -j*x
    ... Is there any speed advantage of using ... where x is real and possible an array and j=sqrt. ... something that is compiler dependent? ... John ...
    (comp.lang.fortran)
  • Re: split regex
    ... Sorry for that John. ... Umesh ... >>> my grep return the values correct to my array and the values in array ... Prev by Date: ...
    (perl.beginners)
  • RecordCount
    ... is there a way to get a record count from a DataReader? ... array based on the count.. ... John ... Prev by Date: ...
    (microsoft.public.data.ado)
  • Re: COM replacement for BYTE* type?
    ... How about a SafeArray of VT_I1? ... John ... > I need to return array of bytes from COM function. ... Prev by Date: ...
    (microsoft.public.vc.atl)
  • Re: Creating an array from file input
    ... johnd wrote: ... > I need to create an array of file names from an existing text file. ... John ... Prev by Date: ...
    (comp.lang.perl.misc)