Explanation received. (re prev. post) [message #3219] |
Fri, 02 December 1994 16:38 |
Russ Welti
Messages: 27 Registered: October 1994
|
Junior Member |
|
|
> The IDL ABS function is a wrapper to the C ABS function. This is the
> value that is returned by that function. I beleive the reason is
> that the absolute value is not really defined for byte data. However,
> I can't really explain what is going on and why it is returning this
> value. You would see the same behavior in a C program. The solution
> is to convert your arguements to integers before taking the absolute
> value.
I guess this makes sense, although I wish the manuals
made note of it, instead of saying that any type may be used with
ABS. For example, it mentions passing strings and complexes to ABS.
Would they also return garbage? Then what's the point?
Maybe it's all so IDL can avoid having a runtime error. But it is
sometimes hard to track down problems like this when a function
like ABS returns something *reasonable*, but wrong.
Anyway, I still like IDL ;) and find the manual is generally good.
\
Russ Welti /-\
(c-g)
University of Washington \-/
Dept. of Molecular Biotechnology M/S FJ-20 /
Seattle, WA 98195 /-\
(206) 685-3840 voice (a-t)
(206) 685-7344 FAX \-/
rwelti@u.washington.edu \
|
|
|