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

Home » Public Forums » archive » Re: strange "eq" behaviour
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
Re: strange "eq" behaviour [message #69769] Mon, 15 February 2010 07:44 Go to next message
david[4] is currently offline  david[4]
Messages: 5
Registered: January 2008
Junior Member
Is maxx exactly 1.0000???

If you type:
maxx=1.
And then execute all "ifs" . All print "true"


If you type
maxx=1.000000000001
help,maxx
MAXX FLOAT = 1.00000
But now all ifs are wrong except last one, because print and help don't
show the real value of maxx.
Try printing with format.
So the question is, How do you get maxx?

chris wrote:
> Hi folks,
> sometimes it's hard to understand IDL interprets, e.g.:
>
> IDL> print,maxx
> 1.00000
> IDL> help,maxx
> MAXX FLOAT = 1.00000
> IDL> if maxx eq 1. then print, 'true' else print,'wrong'
> wrong
> IDL> if maxx eq 1 then print, 'true' else print,'wrong'
> wrong
> IDL> if maxx eq float(1) then print, 'true' else print,'wrong'
> wrong
> IDL> if maxx eq maxx then print, 'true' else print,'wrong'
> true
> IDL> if maxx[0] eq 1 then print, 'true' else print,'wrong'
> wrong
> IDL> if maxx[0] eq 1. then print, 'true' else print,'wrong'
> wrong
> IDL> if 5 eq 5. then print, 'true' else print,'wrong'
> true
>
>
> What's going wrong here? Has somebody an idea? Is this a bug or a
> feature ;)
> I use IDL 6.4.1 within Windows 7 x64 Pro
>
> Thanks and regards
>
> Chris
>
Re: strange "eq" behaviour [message #69867 is a reply to message #69769] Mon, 15 February 2010 07:54 Go to previous message
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
Hi David,
maxx is the correlation coefficient of some data series. It should be
exactly 1 if two data vectors are equal - but it isn't - so now I run
into bigger problems with the inbuilt correlate function . Anyway,
thanks for your hint.

CR
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Editing Shapefile
Next Topic: strange "eq" behaviour

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

Current Time: Wed Oct 08 18:55:21 PDT 2025

Total time taken to generate the page: 0.00580 seconds