comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Please explain this if you can: (short)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Please explain this if you can: (short) [message #3212 is a reply to message #3211] Mon, 05 December 1994 02:36 Go to previous message
sjt is currently offline  sjt
Messages: 72
Registered: November 1993
Member
Russ Welti (rwelti@chroma.mbt.washington.edu) wrote:
: Try this:

: IDL> a=bytarr(20)
: IDL> a(3)=244
: IDL> print,min(a)
: 0
: IDL> print,max(a)
: 244
: IDL> print,abs(max(a)-min(a))
: 12
: IDL> print,max(a)-min(a)
: 244


: What gives?
: \
: 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 \


Evidently ABS isn't very bright! BYTE quantities are unsigned (try print,
min(a) - max(a)). But ABS for takes MSB set => negative and does a two's
complement on the argument.

--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| "If all else fails--read the instructions!" | |
+----------------------------------------------------------- --+---------+
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: how to calculate a running total of a vector
Next Topic: WIDGET_TEXT

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 08:29:35 PDT 2025

Total time taken to generate the page: 2.08065 seconds