All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: David Fries <david@fries.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: W1: w1_slave units, standardize 1C or .001C?  Break API
Date: Tue, 22 Jan 2008 20:22:07 -0800	[thread overview]
Message-ID: <4796C0EF.6010600@zytor.com> (raw)
In-Reply-To: <20080123040937.GB4025@spacedout.fries.net>

David Fries wrote:
> On Mon, Jan 21, 2008 at 07:11:07PM -0800, H. Peter Anvin wrote:
>> H. Peter Anvin wrote:
>>> Millikelvins would have the nice property of never being negative.  :)
> 
> True, but the sensor returns the value as a signed integer in C.  That
> is where the earlier negative number problem was, it would have to do
> yet another conversion to go to Kelvin, and it would be just one more
> potential for error.  Everyone knows that a bad conversion doomed at
> least one space craft, let's stick to Centigrade.
> 

Uhm... the conversion is exact as long as you have at least centikelvin 
precision (0 °C = 273.15 K by definition, and the multiplier is 1.)

>> Alternatively, centikelvins would fit nicely in 16 bits if anyone cares...
>>
>> 655.35 K = 382.20 °C = 719.96 °F
> 
> The range for the sensor is -55 to 125 C, if an application didn't
> care about precision they could store it in a signed 8 bit value just
> fine.

This was more a comment as to it possibly being a convenient format for 
more than this particular sensor.

The nice thing with kelvins is no need to worry about negative numbers 
and something misparsing them, that's all.

I certainly did not imply that we should even consider use °F.  That's 
obviously ridiculous.

	-hpa


  reply	other threads:[~2008-01-23  4:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-21 23:15 W1: w1_slave units, standardize 1C or .001C? Break API David Fries
2008-01-22  1:08 ` H. Peter Anvin
2008-01-22  3:11   ` H. Peter Anvin
2008-01-22 21:07     ` Evgeniy Polyakov
2008-01-22 21:12       ` Evgeniy Polyakov
2008-01-23  4:09     ` David Fries
2008-01-23  4:22       ` H. Peter Anvin [this message]
2008-01-22 21:06 ` Evgeniy Polyakov
  -- strict thread matches above, loose matches on Subject: below --
2008-01-23  4:00 David Fries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4796C0EF.6010600@zytor.com \
    --to=hpa@zytor.com \
    --cc=david@fries.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.