[ltp] T22 temperature
FeRD
linux-thinkpad@linux-thinkpad.org
Thu, 19 Oct 2006 01:22:01 -0400
Don Perley wrote:
> FWIW, 92C is about 198 F, and 97C is about 207 F. Looks like you
> forgot the 32 degree offset, +/- some truncation. That's significant.
Huh, you're absolutely right.
...Which is disturbing, because I knew damn well I couldn't be trusted
doing that math, so I let units(1) do it all. Turns out I was right, I
couldn't be trusted doing that math.... with units(1).
[ferd@-------]~% units
2438 units, 71 prefixes, 32 nonlinear units
You have: 92 degC
You want: degF
* 165.6
/ 0.0060386473
You have: 97 degC
You want: degF
* 174.6
/ 0.0057273769
Here, FeRD demonstrates that letting units(1) do your math is only
advisable when you know how to ask it the right questions. (Or are
paying attention enough to sanity-check things like the fact that 97C
should be pretty damn close to 212F. Not almost 40 degrees shy.) Looks
like I should have phrased this:
You have: tempC(92)
You want: tempF
197.6
You have: tempC(97)
You want: tempF
206.6
I won't go into what units tries to do with 'degC' and 'degF' that
allowed me to trick myself into (not-)thinking I had generated the
proper conversions. The morbidly curious can always type 'help degC'
into a "You have:" prompt like I did. (If Larry Wall had written the
units definition file, at least that section would be preceded by a "#
Here be dragons" comment or similar warning. I want my brain back.)
Oops(TM). "Sorry! My Bad!"
-FeRD