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

Home » Public Forums » archive » Re: Comparing 2 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: Comparing 2 arrays [message #55557 is a reply to message #55556] Sun, 26 August 2007 08:40 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
> If your arrays are the same size, there is no problem using structures.
> You could subtract the two values and call the result "equal" if
> the difference was "sufficiently" close to zero.
>
> IF Total( (data1.A - data2.B) LT 1e-6) EQ N_Elements(data1.A) THEN $
> Print, 'The arrays are equal' ELSE Print, 'The arrays are unequal'
>
> Cheers,
>
> David

David,

to get back to a previous discussion we had a few month ago about being
"sufficiently close to zero", shouldn't it be (data1.A - data2.B) LT
epsilon * data1.A , with epsilon=(machar()).eps?

Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is there somebody familiar with nurbs or b-Spline?
Next Topic: File Output in IDL

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

Current Time: Sun Oct 12 07:18:13 PDT 2025

Total time taken to generate the page: 0.32155 seconds