How do the <> operators deal with negative numbers?
for example;
x == -200
if x < -100
is the answer true or false?
Sorry if I have not explained this clearly.
I suppose I am asking is -200 a greater or lesser value than -100 ?
How do the <> operators deal with negative numbers?
for example;
x == -200
if x < -100
is the answer true or false?
Sorry if I have not explained this clearly.
I suppose I am asking is -200 a greater or lesser value than -100 ?
You mean as in if you owe $200 is that more or less than owing $100? Draw a line on a piece of paper. Put a mark at 0. Put a mark at -100, Put a mark at -200. Which mark is leftmost (smallest)?
PaulS:
You mean as in if you owe $200 is that more or less than owing $100? Draw a line on a piece of paper. Put a mark at 0. Put a mark at -100, Put a mark at -200. Which mark is leftmost (smallest)?
So -200 is less than -100 (as seen by the operators)?
Think of negative numbers as being LESS positive than 0.
ajofscott:
Think of negative numbers as being LESS positive than 0.
Got it !, Many thanks
Paul