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 
Switch to threaded view of this topic Create a new topic Submit Reply
Comparing two float arrays upto 0.0001 precision [message #93951] Sun, 04 December 2016 22:58 Go to next message
priyamalik484 is currently offline  priyamalik484
Messages: 7
Registered: December 2016
Junior Member
Dear all,

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????

Thanks in advance!!
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Label in CgDrawShapes
Next Topic: How to work with scripts?

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

Current Time: Wed Oct 08 13:36:36 PDT 2025

Total time taken to generate the page: 0.00638 seconds