diff options
author | Constantine A. Murenin <cnst@cvs.openbsd.org> | 2008-03-16 23:54:02 +0000 |
---|---|---|
committer | Constantine A. Murenin <cnst@cvs.openbsd.org> | 2008-03-16 23:54:02 +0000 |
commit | a5448f5ca7c4a0cc0f492de0157ac0c6826322e3 (patch) | |
tree | 14e9ba421ad2942c7d9e3dcf39473345b2a53075 /usr.sbin | |
parent | 352fe801dfeb83bec7068f521687c384bd935e38 (diff) |
s/273.16/273.15/g, then refactor the formulae to ensure that the
double to int64_t conversions happen sooner rather than later
discussed with / ok by kettenis
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sensorsd/sensorsd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/sensorsd/sensorsd.c b/usr.sbin/sensorsd/sensorsd.c index d45e07237d0..1cd8a772532 100644 --- a/usr.sbin/sensorsd/sensorsd.c +++ b/usr.sbin/sensorsd/sensorsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensorsd.c,v 1.40 2008/03/16 03:07:03 cnst Exp $ */ +/* $OpenBSD: sensorsd.c,v 1.41 2008/03/16 23:54:01 cnst Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -642,11 +642,11 @@ get_val(char *buf, int upper, enum sensor_type type) switch(*p) { case 'C': printf("C"); - rval = (val + 273.16) * 1000 * 1000; + rval = val * 1000 * 1000 + 273150000; break; case 'F': printf("F"); - rval = ((val - 32.0) / 9 * 5 + 273.16) * 1000 * 1000; + rval = (val * 1000 * 1000 + 459670000) / 9 * 5; break; default: errx(1, "unknown unit %s for temp sensor", p); |