|
-
November 14th, 2006, 05:39 PM
#1
If statement question
I feel extremely stupid for asking this question but its driving me bonkers. It just wont work!
Say you have a variable A. Its 2000.
A = 2000
You have a variable B. Now, B is gonna be something, just dont know what yet. But there are certain things you want to do for each.
If A is bigger than twice the size of B, do this.
If A is bigger than Three times the size of B, do this.
If A is bigger than four times the size of B, do this.
You get the drift, right?
Now I cant just do A = (2*B) cause I if A is 2000 and b is 900, well its not equal 1800, but it is bigger than 900 * 2.
This should be super simple, and I feel stupid cause its not working right... I have (basically)
if(A > (5 * B))
else if(A > (4 * B))
else if(A > (4 * B))
else if(A > (2 * B))
else
Cept it doesnt work. Say A is 2000. Even if the number is 1000, it still uses the first one (If A is 5 times bigger than B). Which its not. >_> Its only 2 times bigger
Any ideas? =D And try not to laugh at me too hard.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|