# Type for difference of two absolute values

I always see that people in the fields consider confusing vectors with positions as a severe error in one and n dimensions. Recently I have also encoutered a timedelta type in Python. By increadably inadequate reaction and severe punishment, I realize that people in the fields taboo answering why is the difference.

Might be the computer scientists are different and can tell the principal difference among the types. Does time differece has different nature from the datetime? Does a = b-c has the same nature as the b and c? In which case do you introduce a new type? Why do they say that a has the same type in case of int but not in case of time or position?

Is this related to dimensional analysis? It seems like dimensional analysis would say that a has the same unit of measurement (and therefore the type) as the b and c in a=b-c. Is this correct?

• Hey Val, you just rolled back a bunch of the edits I made to improve the question. Your rollback re-introduced spelling mistakes, grammar errors, rant-y statements that are not relevant here ("increadably inadequate reaction and severe punishment" - come on), and other problems. Please don't do that. This is a community site with shared ownership of questions. Please see Why can people edit my posts? How does editing work? to understand the site model, and don't gratuitously roll back edits that others have made to improve your question.
– D.W.
Nov 29, 2013 at 20:02
• Your "ownership" removed a half of my question. I have told you that my question is more general than time alone. Might be you will invent the questions for me next time?
– Val
Nov 29, 2013 at 21:50
• I don't think my statement is really worth a separate answer, so I reply with a comment. The problem is as simple as this: the difference between two dates is not a date. The difference between two ints is an int. I don't think this has anything to do with dimensional analysis, as it makes sense to talk about it in the context of types for which addition and multiplication is defined. Nov 30, 2013 at 13:57
• @Val, Well, consider what do we actually mean by dates? Date is some specific point in time, e.g. May 1 or May 7th. The difference of those dates, however, is not a point in time itself, it's a whole week. For example one might say "What were you doing on the 1st of May", but "What were you doing between the 1st of May and the 7th of May". Nov 30, 2013 at 14:14
• @Val, Haskell does have a timediff function, in fact, it takes two dates and returns a time difference. '-6 days' is not a date in the same sense as '1th of January, 12:00 GMT' is. The subtraction on timediffs can be easily defined and I think it's reasonable that the sum or subtraction of two timediffs is a timediff. Nov 30, 2013 at 17:31