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 #90570 is a reply to message #90568] Tue, 10 March 2015 13:19 Go to previous messageGo to previous message
Burch is currently offline  Burch
Messages: 28
Registered: December 2013
Junior Member
On Tuesday, March 10, 2015 at 3:15:18 PM UTC-5, Jahvasc wrote:
> Hi, Chris, thank you for your answer. But it was to avoid this floating point problems that I'm using the intervals. Besides, why when I write down the interval (mass gt 0.04 and mass le 0.05) I got the the right answer?

Unfortunately you're not quite avoiding those issues. For instance, analogous to what you're doing try this

IDL> print, 0.05 le 4.0*0.01+0.01
0

IDL> print, 0.05 le 0.05
1

The first example *should* return 1 in a perfect world, but once you do mathematical operations (such as the multiplication and addition) you will introduce floating point arithmetic issues.
[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: Wed Oct 08 18:26:07 PDT 2025

Total time taken to generate the page: 0.00466 seconds