View Full Version : What is the variable for subtract ?
redchannel
Jun 18, 2009, 09:13 PM
I know the variable for addition is sum.
what is the variable for subtraction ?
admanimal
Jun 18, 2009, 09:22 PM
Generally speaking, the names of variables are irrelevant to what you are actually doing with them.
redchannel
Jun 18, 2009, 09:23 PM
Can someone just tell me what the variable for subtract is ? thats all i want
admanimal
Jun 18, 2009, 09:25 PM
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
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.
CocoaPuffs
Jun 18, 2009, 10:20 PM
It's actually "-", believe it or not.
sammich
Jun 18, 2009, 10:23 PM
subtr?
jerrywickey
Jun 19, 2009, 06:47 AM
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
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.