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

Home » Public Forums » archive » Re: How to test for a vector/matrix of constants?
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: How to test for a vector/matrix of constants? [message #51762 is a reply to message #51761] Wed, 06 December 2006 13:26 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Bob Crawford wrote:
> On Dec 6, 3:54 pm, Paul van Delst <Paul.vanDe...@noaa.gov> wrote:
>> I think Bob's solution is the safest since that is the only one that doesn't use the "EQ"
>> operator. Insert the usual reasons here for not wanting to use "EQ" to compare floats.
>
> Paul,
>
> Most of the other suggestions are actually using the EQ on integers
> (array subscript values).
> Lots of interesting approaches.

Well, apart from yours, only one other.

From Allan:
if (where(vector ne vector[0]))[0] eq -1 then print,'all same'
-> potential float comparison.

From Braedley
if n_elements(uniq(array, sort(array))) eq 1 then ;flag it
-> No float comparison

From Lajos
mini=min(array, max=maxi)
if mini eq maxi then ...
-> Potential float comparison

Some of said constant, equal numbers could be more equal than others. :o)

cheers,

paulv

--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Ph: (301)763-8000 x7748
Fax:(301)763-8545
[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
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Martin Shultz's MSG_GUI
Next Topic: Re: histogram along y-axis

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

Current Time: Sat Oct 11 05:58:58 PDT 2025

Total time taken to generate the page: 0.79804 seconds