Michael,

It sounds to me like you're making this altogether too complicated. Don't focus on the software; focus on the science.

The size of the "degree" unit is the same for Kelvin and Celsius. (I.e., if the temperature changes by 1 degree K, it changes by exactly 1 degree C.) The only this that is different between Kelvin and Celsius is the zero point. For Kelvin, 0 degrees is absolute zero and there are no negative values of temperature. (Well, that's not quite right, but you'll never encounter the exceptions.) For Celsius, 0 degrees is the freezing point of water at sea level. To convert between Kelvin and Celcius, just add or subtract a constant. That constant has a value of 273.15.

That is, you can make a dimensionally-safe conversion from Kelvin to Celcius by subtracting 273.15. Converting from Celsius to Kelvin by adding 273.15.

Cheers,

Rick Aurbach
Aurbach & Associates, Inc.

On Aug 15, 2013, at 9:24 AM, boost-users-request@lists.boost.org wrote:

From: Michael Powell <mwpowellhtx@gmail.com>
Subject: [Boost-users] [units] "Simple" conversion from Kelvin to Celsius
Date: August 14, 2013 2:39:56 PM CDT
To: "boost-users@lists.boost.org" <boost-users@lists.boost.org>
Reply-To: "boost-users@lists.boost.org" <boost-users@lists.boost.org>


Hello,

It's been a couple of years since I've done any work with Boost.Units,
and I am finding that I want to make a dimensionally-safe conversion
from Kelvin to Celsius.

I've got an I2C controller that reports in Kelvin, but I want to
report it to the end-user in Celsius.

The examples I am finding seem to "almost" fit the bill, but I am
having a difficult time extrapolating a sane conversion.

First, would help if I understood what the Boost.Units SI (my assumed
base-system) base-temperature units were. I gather Fahrenheit? Or is
it indeed Kelvin? I could be mistaken.

Thank you...

Regards,

Michael Powell