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 #38033 is a reply to message #38032] Mon, 16 February 2004 19:53 Go to previous messageGo to previous message
MKatz843 is currently offline  MKatz843
Messages: 98
Registered: March 2002
Member
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
[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 19:13:29 PDT 2025

Total time taken to generate the page: 0.00488 seconds