# What is $5^\circ \mathrm{F}$ minus $5^\circ \mathrm{F}$?

Is it $$0^\circ \mathrm{F}$$ or is it $$0\,\mathrm{K}$$ (Kelvin)?

From an arithmetic standpoint, it seems like it should be $$0^\circ \mathrm{F}$$, but that seems inconsistent because the result represents a delta ($$0 \,\Delta^\circ \mathrm{F}$$ perhaps) which is conceptually completely different. Doing math with units like $$^\circ\mathrm{F}/s$$ completely breaks down.

From a natural sciences standpoint, it's 0 K, because an amount of heat minus the same amount of heat is no heat, but that seems inconsistent because everyone knows that $$5 - 5 = 0$$, and this would instead yield $$5^\circ \mathrm{F} - 5^\circ\mathrm{F} = -459.67^\circ\mathrm{F}$$, which may be surprising.

Is there a convention for doing arithmetic on Interval Scale measurements? That same page suggests there is a difference operation for them in its comparison table.

For context, I'm working on a Python library for doing dimensioned arithmetic (with an eye towards the natural sciences) and interval scales are making things complicated. For instance, $$^\circ\mathrm{F}\cdot s$$ doesn't seem to represent a meaningful physical dimension; it can't be converted to $$\mathrm{K}\cdot s$$. For example, trying to convert $$6^\circ\mathrm{C}\cdot s$$ by visualizing temperature and time as axes: • As possible follow ups: What is $5^\circ F - 4^\circ F$? And what is $5^\circ F - 7^\circ F$? Aug 8, 2021 at 17:21
• "From a natural sciences standpoint, it's 0 K because an amount of heat minus the same amount of heat is no heat". True but inappropriately applied. A temperature of $5^{\circ}$F, which represents $\textbf{well over}$ $300^{\circ}$ K of heat, still contains well over $300^{\circ}$ K of heat when $5^{\circ}$ F (approx $2.7 ^{\circ}$ K) is deducted. Aug 8, 2021 at 17:46
• Temperature is not the same as amount of heat Aug 8, 2021 at 17:53
• What meaning does $5^\circ - 5^\circ$ have? You can't have an answer if a question is not well defined. Aug 8, 2021 at 17:55
• This is one reason that some find it useful to distinguish between $5^\circ \text{F}$ (measurement of temperature on Fahrenheit scale) and $5\text{F}^\circ$ (difference from $0^\circ \text{F}$ to $5^\circ \text{F}$). It's actually the notation I learned originally in high school physics, but since have not seen it in wide use... Aug 8, 2021 at 18:04

You seem to have the correct idea that it's important to distinguish between temperatures and temperature changes. So to answer your question, you'll need to first decide what the question is, i.e., do those two occurrences of $$5^\circ F$$ in the question refer to temperatures or to temperature changes?

For example, if they're both temperatures, then subtracting produces a temperature change of $$0^\circ F$$, which is the same as a temperature change of $$0\ K$$.

For another example, if the first $$5^\circ F$$ is a temperature and the second is a temperature change, then subtracting produces a temperature of $$0^\circ F$$, which is very different from a temperature of $$0\ K$$.

• Alternatively, if you really hate having to maintain this distinction, you can limit your library's supported units to Kelvin and Rankine, and exclude non-absolute temperature scales. Because on an absolute scale, the difference is trivial. Aug 9, 2021 at 7:57
• +1, but I think it would be clearer to talk about "temperature differences" rather than "temperature changes"?
– Jan
Aug 9, 2021 at 8:41
• @Kevin OP would either have to distinguish between temperatures and temperature differences, or be unable to use Celsius and Fahrenheit as temperature units. I think the second choice would severely limit the usefulness of the library for many users.
– Jan
Aug 9, 2021 at 8:54
• @Jan I considered using "difference" rather than "change", but that clashed with the use of "difference" to mean the result of subtraction. In my second example, the result of subtraction is a temperature, not a temperature difference. Of course, it would not be difficult to explain the situation and thereby avoid the clash, but I'd rather not do that at the same time that I'm emphasizing the two possible meanings of $5^\circ F$. Aug 9, 2021 at 14:57

If the temperature is $$5^\circ \text{F}$$, and then the temperature drops 5 degrees (F), the temperature is now $$0^\circ \text{F}$$.

• Water freezes at $32^\circ \text{ F}=0^\circ \text{ C}=273.15 \text{ K}$. Thus $0^\circ \text{ F} = (0-32)(5/9) \text{ C} = -17.78\text{ C} = (273.15-17.78) \text{ K} = 255.37 \text{ K}.$ Not very warm, but much warmer than $0 \text{ K}.$
– mjw
Aug 9, 2021 at 3:48

There have been great answers so far, but I'd like to focus on the practical implementation side of this. Which operations do you implement and how?

Temperature forms an affine line, no matter which unit you're using. It is much like with dates and time: you cannot add last Tuesday to 17 October of 2015, what would that even mean? And so Python does not let you add two instances of datetime. You can subtract them, though, giving you a timedelta object.

Similarly, you would need to implement a delta-temperature unit to represent differences in temperature. This delta-temperature can then implement the same operations as timedelta: you can add them together or subtract them, you can scale them by a scalar, you can divide two delta-temperatures to get a scalar value, and you can add or subtract from a temperature value.

One of the following (well, both are true, but they're different statements):

5°F - 5Δ°F = 0°F.
5°F - 5°F = 0Δ°F.

If we treat these two things as basically different units, then we can make relatively sane mathematical statements. We can also distinguish, e.g.:

32°F = 0°C, but
32Δ°F ≅ 17.8Δ°C.

Your question is analogous to how we deal with time, and it is like asking "If you subtract 3 PM from 5 PM, do you get 2 PM or 2 AM?"

In Python, there is a distinction between datetimes and timedeltas. Subtract a datetime from a datetime and you get a timedelta. Subtract a timedelta from a datetime and you get a datetime.

It sounds like your library needs something like that. Subtract a temperaturedelta from a temperature to get another temperature. Subtract a temperature from another temperature to get a temperaturedelta. No more ambiguity.

This seems more like a physics question than a mathematics question. The way that I learned this (in physics class) was $$5^\circ \text{F} - 5^\circ \text{F} = 0 \text{F}^\circ$$Meaning that the difference between two temperatures measured in Fahrenheit such that both are 5 is zero degrees of Fahrenheit. Note that the degree symbol moves. That's how we know that the first two numbers are temperatures and the third number is a temperature difference.

We could also have $$5^\circ \text{F} - 0 \text{F}^\circ = 5^\circ \text{F}$$That means that changing a temperature by zero degrees results in the same temperature. Or $$5 \text{F}^\circ + 5 \text{F}^\circ = 10 \text{F}^\circ$$

What we can't do, is say $$\color{red} {5^\circ \text{F} - 5^\circ \text{F} = 0^\circ \text{F}}$$That's just nonsense. When you subtract two temperatures, you don't get a temperature but a temperature difference. Also $$\color{red}{5^\circ \text{F} + 5^\circ \text{F} = 10^\circ \text{F}}$$Again nonsense. You can't meaningfully add temperatures. I don't know what units that would produce, but it is neither a temperature nor a temperature difference.

It's a bit confusing, as the only difference in the units is the position of the degree symbol. Degrees Fahrenheit is a temperature while Fahrenheit degrees is a temperature difference. This also works for Celsius and Rankine. My book when I learned it was old enough that it used the same thing for Kelvin, but that hasn't been true since 1968 (so I learned it incorrectly and will not try to explain the correct notation for a temperature difference in the Kelvin scale).

I also would try to avoid mixing Kelvin and Fahrenheit. Either use Rankine and Fahrenheit or Kelvin and Celsius. Convert whichever is necessary. Because $$275 \text{K} - 1 \text{C}^\circ = 274 \text{K}$$but $$275 \text{K} - 1 \text{F}^\circ = 274.\overline{4} \text{K}$$But if we adjust for significant digits, that would be $$274\text{K}$$ The same as $$275 \text{K} - 2 \text{F}^\circ = 273.\overline{8} \text{K} \approx 274\text{K}$$It would be less bad to mix Rankine temperatures and Celsius differences (as Celsius degrees are larger than Rankine degrees), but of no purpose. Anyone who knows what the Rankine scale is also knows Kelvin.

In terms of your library, I think that you need at least three separate functions. One should allow addition of a temperature and temperature difference (which can be negative) and produce a temperature as the result. The second should subtract two temperatures and produce a temperature difference as the result. The last should allow the addition of temperature differences and result in a temperature difference. You might also implement temperature difference subtraction and statistical operations on temperatures (which would take a list of temperatures and produce a temperature statistic). Note that some statistics won't have meaningful units (e.g. variance) while others will (mean, median, standard deviation, etc.).

It might be easier to write this library with strong types. I'm not sure how difficult that is in Python. You want it to treat adding two temperatures like it would adding a number and a string, as an error condition. Meanwhile, adding a temperature difference is fine. Or subtracting two temperatures, although weirdly that would change the type.

• Since you cannot add temperatures, the concept of average temperature doesn't exists? That would be quite a claim. Aug 9, 2021 at 8:34
• @lalala But you don't get an average temperature by adding the temperatures. You get an average temperature by converting all the temperatures to the same unit, stripping off the unit, adding the magnitudes, then dividing that sum by the count, and finally you can put the temperature unit back. Because the total of the magnitudes has no meaningful unit. It's not a temperature. It's just a number. Aug 9, 2021 at 9:35
• So you say I could not add temperatures, but if I want I can take the magnitude add those and then add the unit? Do you think of adding of unit quantities always like that? Like 1s+1s - > 1 +1=2 - >2s? Aug 9, 2021 at 10:59
• No, because both one and two seconds are meaningful. But if I add 50 deg and 100 deg, it's not a 150 deg temperature. Even if they average to 75 which is. It's meaningful to add time periods. Now, if we are talking dates, it is not meaningful to add two dates. E.g. today and tomorrow don't make a new date in 2042. So dates are like temperatures, but time periods are not. They're like temperature differences which can also be added. Aug 9, 2021 at 11:05
• Heat is energy that is transferred from one body to another as the result of a difference in temperature.
• Temperature is a measure of hotness or coldness expressed in terms of scales like Celsius and Fahrenheit.
• Kelvin is a thermodynamic scale. Zero Kelvin ($$0 K$$) is ABSOLUTE ZERO. It is absolute because to go any lower would require that a gas exert negative pressure. At $$0 K$$, all particles stop moving and all disorder disappears, i.e. there no motion and no heat.

So, to answer the question: $$5 ℉ - 5 ℉ = 0 ℉$$ NOT zero K (Kelvin)

This part of the question is incorrect, that the answer is 0 K from a natural sciences context:

From a natural sciences standpoint, it's 0 K, because an amount of heat minus the same amount of heat is no heat, but that seems inconsistent because everyone knows that 5 - 5 = 0, and this would instead yield 5 ℉ - 5 ℉ = -459.67 5 ℉, which may be surprising.

The relationship between heat transfer and temperature change is $$Q = mcΔT$$ where Q = heat transfer, m is mass of whatever you're making colder or hotter, c = specific heat capacity, and ΔT is the change in temperature. It is a thermodynamic process, not an arithmetic one. That is where I think the confusion is. You mentioned delta, but you need to decide whether you want to calculate a delta (change) in temperature, or heat transfer.

Conceptually you will need new units to express temperature differences. Let's use Δ℉ as you hinted. Then 5 ℉ minus 5 ℉ will be equal to 0 Δ℉ which in turn will be equal to 0 ΔK.

Temperature differences will form a vector space over the reals. You can add them, multiply them with a scalar and take their inverse. This is in contrast with temperature values themselves, where these operations are not meaningful. However, now you can add a temperature and a temperature difference to get a temperature.

Fahrenheit (degree F) is a scale, kelvin (K, without the word "degree") is a measurement unit (and may be used as a scale as well).

Kelvins are additive. They can be added and subtracted and the results have direct physical meaning as long as one doesn't get a negative temperatures (and in some cases, even then).

Degrees F are additive to an extent. Differences between temperatures are additive, the temperatures themselves - not much, as is visible in the question.

If you looks for a measurement unit that is sized to the Fahrenheit scale, but has this useful property of the kelvin unit, look at the Rankine scale.

0 degrees Rankine are 0K (the absolute zero temperature), but the scale unit is equal to degree Fahrenheit rather than degree Celsius.

For context, I'm working on a Python library for doing dimensioned arithmetic (with an eye towards the natural sciences) and interval scales are making things complicated.

I recommend refraining from giving the impression that subtracting temperatures is a correct thing to do.

Per @EllieKesselman's physics-based answer on can subtract temperatures in a meaningful way in basic physics or related science.

Before calculus is taught, we do use $$\Delta T$$.

The example given in that answer assumes heat capacity $$c$$ as a constant, which for a real system it isn't. So while we might do this as a short-cut on the back of an envelope, we really don't subtract temperatures for serious results. We integrate various thermodynamic expressions with various constraints.

Relevant to the addition addition of temperatures is the reaction of Richard Feynman.

which is ~okay when done on envelope backs, once you've allowed for that it will be hard to avoid the temptation to then allow addition of temperatures as well.

Then comes the list of problems. It says, "John and his father go out to look at the stars. John sees two blue stars and a red star. His father sees a green star, a violet star, and two yellow stars. What is the total temperature of the stars seen by John and his father?" – and I would explode in horror.

My wife would talk about the volcano downstairs. That's only an example: it was perpetually like that. Perpetual absurdity! There's no purpose whatsoever in adding the temperature of two stars. Nobody ever does that except, maybe, to then take the average temperature of the stars, but not to find out the total temperature of all the stars! It was awful! All it was was a game to get you to add, and they didn't understand what they were talking about. It was like reading sentences with a few typographical errors, and then suddenly a whole sentence is written backwards. The mathematics was like that. Just hopeless!

• If that's the case, then Feynman's quote isn't relevant to answering the question. He only specified that one shouldn't arbitrarily sum temperatures, although it is acceptable to sum them as part of getting an average. He didn't say anything about subtracting temperatures. This question is about subtraction. I was just trying to help you with your answer in my prior comment, without being too brusque. Aug 9, 2021 at 6:57
• Feynman knew thermodynamics, aka physical chemistry. Take a look at my answer. The heat transfer equation requires a change in temperature, delta T. The Feynman quote that you provided is correct. And so am I about changing (whether adding or substracting) temperature, i.e. delta T. That's why I am confused, as your answer in large bold font "Do not add or subtract temperatures!" is synthesis of your own. Feynman didn't say it, nor do I understand how the Feynman passage is relevant to answering the question. Maybe it should be a comment? Aug 9, 2021 at 7:12
• @EllieKesselman I'm on foot with a phone on a sunny afternoon, off to buy groceries now that the tropical storm has passed. To give your answer the read and thought that it deserves I'll need 2 more hours.
– uhoh
Aug 9, 2021 at 7:26
• I'm sorry! Please don't go to any trouble. Enjoy your sunny afternoon buying groceries. That sounds wonderful! Aug 9, 2021 at 7:28
• @EllieKesselman Yes I see what you mean. I've elaborated on my answer, addressing subtraction first, then warning separately about addition, since that may tend to naturally follow for some user's of the OP's educational software. "Subtract with caution and caveats, add at your own peril."
– uhoh
Aug 9, 2021 at 10:04

While others touched the physics aspect, that's not that relevant for you actually. You are a developer, and what matters is what your users will expect.

If I was a user of that library you develop, I would expect 0℉. Simply because if anyone would deal with absolute temperatures, he should use kelvins automatically. when I write 5℉ - 5℉, what anyone would naturally mean is "what is the temperature that is 5℉ lower than 5℉?"