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 
Return to the default flat view Create a new topic Submit Reply
Re: strange "eq" behaviour [message #69769] Mon, 15 February 2010 07:44 Go to previous 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
>
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Editing Shapefile
Next Topic: strange "eq" behaviour

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

Current Time: Fri Oct 10 23:53:26 PDT 2025

Total time taken to generate the page: 0.95970 seconds