   Why will this if statement not work?
  Once again ran into a problem that I can't figure out.. after I got the last one solved, I've been sitting here trying to figure this one out.Does anything look wrong with this function to you?bool block::atBottom(){    if(x <= -0.9)    {   moveable = false;   return true;    }    else   return false;}I put in error checking message boxes before and after the if(x <= -0.9) it shows up before, but not inside the brackets. Why will this inequality not work?P.S. x is part of the block class, and so is moveable, if that variable matters in this situation, which it shouldn't.P.P.S It's probably something I'm going to feel stupid for, but hey, its 2:00 AM here.   
  What type is x?   ;  float   ;  I see nothing wrong in that code. Maybe you should try to print out the value of 'x' and see what it is set to.   ;  The <= makes me think you're counting on equality, which is a No-No when you're working with floating point numbers.float a = 0.9 / 3.0;if(a <= 0.3){    // This may not execute!}Put simply, to a computer, 0.9/3.0 may equal 0.9000000000243, even if it prints out as 0.9. For more, read this.   ;  I can't figure out how to print it out, it won't let me convert it from float to const char*, so I can pass it through MessageBox(). Hmmmm.   ;  If that is the case, then how can I tell my blocks when to stop on the board, when they reach the bottom?   ;Quote:Original post by NiddlesI can't figure out how to print it out, it won't let me convert it from float to const char*, so I can pass it through MessageBox(). Hmmmm.Try formatting your message with sprintf().   ;  Set a break point and step through it, probably easier then printing it out in a message box.   ;  The atBottom function is dealing with x.You sure its not supposed to be y?Just a thought...   