Try to avoiding this kind of check. Because 0.3 can be not exactly 0.3. It can be 0.30000000001 or 0.29999999999.
So you can check like this: if round(b*10)=3 (dont like it) or like this: > 0.29 and < 0.31 (for example).