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

Home » Public Forums » archive » Re: Little help on arrays
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: Little help on arrays [message #38032] Mon, 16 February 2004 20:07 Go to previous message
mchinand is currently offline  mchinand
Messages: 66
Registered: September 1996
Member
In article <4a097d6a.0402161953.238c2a73@posting.google.com>,
M. Katz <MKatz843@onebox.com> wrote:
> mchinand@midway.uchicago.edu (Mike Chinander) wrote in message news:> If
> you don't want to compare element by element, you could check to see if
> the max and min of
>> the difference of the two arrays are the same:
>>
>> IDL> if max(a-b) eq min(a-b) then print, 'bingo!'
>
> This gives the wrong result if there's a constant difference between
> the arrays. For example.
> a = [3,4,5,3]
> b = [2,3,4,2]
>
> then
> max(a-b) = max([1,1,1,1]) = 1
> yet
> min(a-b) = min([1,1,1,1]) = 1
> So they're equal, but the arrays aren't.
>
> M. Katz

Yes, I realized that after seeing someone else's similar solution which
does the needed check to make sure the max is equal to zero.

--Mike

--
Michael Chinander
m-chinander@uchicago.edu
Department of Radiology
University of Chicago
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Little help on arrays - 2nd try
Next Topic: array multiplying (for a change)

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

Current Time: Wed Oct 08 15:33:30 PDT 2025

Total time taken to generate the page: 0.00468 seconds