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

Home » Public Forums » archive » where function not finding value
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: where function not finding value [message #90572 is a reply to message #90571] Wed, 11 March 2015 02:16 Go to previous messageGo to previous message
Jahvasc is currently offline  Jahvasc
Messages: 9
Registered: March 2014
Junior Member
Thank you all for your replies.

As I told you, I am aware of the problems caused by floating point precision and I also know that is not related to IDL itself. However, what has astonished me was the fact that different functions or ways to address the problem in IDL produced such discrepant results.

Because of your help, I realised that the problem was in the way I was defining the intervals. In fact, they were too large. Then, I re-wrote the program introducing an eps=1.e-3 value. The loop turned-out to be:

mmod=[findgen(10)*0.01+0.01,findgen(3)*0.1+0.2]
eps=1.d-3
for j=0,12 do begin
a=where(massa ge mmod[j]-eps and massa le mmod[j]+eps,count)
print,mmod(j),count
endfor

Now I get the right counts.
Thank you again!

Cheers,
Jaqueline
[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
Previous Topic: License Manager help
Next Topic: Map_proj_forward.pro

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

Current Time: Fri Oct 10 09:40:13 PDT 2025

Total time taken to generate the page: 1.11670 seconds