NEVER test for equals when you use floats. NO-ONE does this... because floats will always be slightly different on different pc's.
If you want to test for 3.5 you should do... if abs(num-3.5)<0.01 instead.
If you want to test for 3.5 you should do... if abs(num-3.5)<0.01 instead.