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

Home » Public Forums » archive » Re: WHERE problems (longish)
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 problems (longish) [message #35909 is a reply to message #35907] Tue, 22 July 2003 09:07 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Benjamin Panter writes:

> Yeup, thanks for that David - I'm still a bit confused though, as the
> values I give in the test program (3000.) are floats and the values in
> the look up table are also floats! I nievely thought that would avoid
> the razors and ints. Is it just by luck that where found the majority
> and lost those three?
>
> After reading your pages I've come up with a solution though... if I
> replace the where lines with
>
> print, where(abs(3000. - reform(dust_lookup[*,0])) lt 0.1)
>
> I come out with the right answer.

And that would be the right approach. With floats
you can't (generally) ask if one float *equals*
another. You can ask if one float is within some
very tiny delta of another. That's what you ended
up doing here, and it works spectacularly. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Multidimensional Interpolation
Next Topic: about replicate_inplace

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

Current Time: Wed Oct 08 19:24:53 PDT 2025

Total time taken to generate the page: 0.00399 seconds