# What is the variable for subtract ?

Discussion in 'iOS Programming' started by redchannel, Jun 18, 2009.

1. ### redchannel macrumors regular

Joined:
Nov 23, 2008
#1
I know the variable for addition is sum.
what is the variable for subtraction ?

Joined:
Apr 22, 2005
#2
Generally speaking, the names of variables are irrelevant to what you are actually doing with them.

3. ### redchannel thread starter macrumors regular

Joined:
Nov 23, 2008
#3
Can someone just tell me what the variable for subtract is ? thats all i want

Joined:
Apr 22, 2005
#4
Frankly I don't think anyone understands what exactly you are asking.

I took a guess and am telling you that there is no variable name that has to be used with addition nor subtraction. You can call variables whatever you want.

I can say

Code:
```int sum = 5 / 2;
```
and Objective-C (or any other language) would be perfectly happy with that.

If you are just interested in the mathematical term for the result of a subtraction for trivia's sake, that would be difference.

Joined:
Aug 23, 2008
6. ### sammich macrumors 601

Joined:
Sep 26, 2006
Location:
Sarcasmville.
7. ### jerrywickey macrumors member

Joined:
Apr 16, 2009
Location:
Key West
#7
reading you question literally, I think you mean what variable must you place the difference. "difference" is the word mathamaticians use to decribe the result of a subtraction.

But for coding.

sum = 1 + 2
thing = 1 + 2
var1 = 1+ 2

dif = 3 - 1
thing = 3 - 1
(even)
sum = 3 -1

will all accomplish just what they look like they will accomplish

sum = 9 -1
sum = sum - 5

results in, sum containing 3

You get to choose what the variable name is.

Jerry