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

Home » Public Forums » archive » Comparing two float arrays upto 0.0001 precision
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 two float arrays upto 0.0001 precision [message #93952 is a reply to message #93951] Mon, 05 December 2016 02:38 Go to previous message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 12/05/2016 07:58 AM, priyamalik484@gmail.com wrote:
> I am trying to compare two very long float arrays upto precision 0.0001
> without using for loop as it is taking alot time in processing. Can any one
> guide me how to compare two long arrays in float????

A=randomu(seed,100000)
B=randomu(seed,100000)
similar=abs(A-B) le 0.0001

Similar is then a byte array that is 1 where A approx B, 0 elsewhere.
If you want instead a list of indices, where A approx B, use

w=where(abs(A-B) le 0.0001,/null)

By the way, avoid using long for anything else than long integers
(32-bit), otherwise you cause confusion.

I hope this helps, Markus
[Message index]
 
Read Message
Read Message
Previous Topic: Label in CgDrawShapes
Next Topic: How to work with scripts?

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

Current Time: Fri Oct 10 12:33:09 PDT 2025

Total time taken to generate the page: 0.15940 seconds