Re: Question again :) [message #29025] |
Wed, 30 January 2002 05:14 |
the_cacc
Messages: 104 Registered: October 2001
|
Senior Member |
|
|
Note though that ABS for complex numbers can be fairly slow when
operating on large amounts of data (eg. big arrays, inner loops).
Sometimes the use of ABS in not essential if, for example, you have a
situation requiring the following:
ABS(z) GT threshold
then it is quicker to use
FLOAT(CONJ(z) * z) GT threshold^2
instead.
Ciao.
|
|
|
Re: Question again :) [message #29036 is a reply to message #29025] |
Tue, 29 January 2002 11:57  |
Stein Vidar Hagfors H[1]
Messages: 56 Registered: February 2000
|
Member |
|
|
dinhnq@yahoo.com (Dinh Huong) writes:
> Dear all,
>
> Is there any function that can calculate a complex�s mod? Suppose c =a
> + bi, which directly return sqrt(a^2+b^2).
IDL> print,abs(complex(-1,1))
1.41421
--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO
NASA Goddard Space Flight Center, Email: shaugan@esa.nascom.nasa.gov
Mail Code 682.3, Bld. 26, Room G-1, Tel.: 1-301-286-9028/240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
|
|
|