Re: cmplx(0.,-x) or -j*x
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Wed, 25 May 2005 22:27:58 -0700
gh14tq5@xxxxxxxxx wrote:
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?
Well, the CMPLX version should pretty much just copy the data. The second one possibly will actually do multiplication. I would hope an optimizing compiler would figure it out, but I wouldn't guarantee it.
-- glen
.
- References:
- cmplx(0.,-x) or -j*x
- From: gh14tq5
- cmplx(0.,-x) or -j*x
- Prev by Date: Re: My philosophy
- Next by Date: static function ? how ?
- Previous by thread: cmplx(0.,-x) or -j*x
- Next by thread: Re: cmplx(0.,-x) or -j*x
- Index(es):