Re: where function not finding value [message #90570 is a reply to message #90568] |
Tue, 10 March 2015 13:19   |
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.
|
|
|