Skip to content
Prev 164872 / 398503 Next

Find all numbers in a certain interval

Antje wrote:
Not in general, but in this particular case "abs(a) < 0.5" gives you the 
right result.

By the way, some advice I read many years ago (in Kernighan and 
Plauger):  always use < or <=, avoid > or >= in multiple comparisons.  
It's easier to read

-0.5 < a & a < 0.5

than it is to read the form you used, because it is so much like the 
math notation -0.5 < a < 0.5.

Duncan Murdoch