summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorConstantine A. Murenin <cnst@cvs.openbsd.org>2008-03-16 23:54:02 +0000
committerConstantine A. Murenin <cnst@cvs.openbsd.org>2008-03-16 23:54:02 +0000
commita5448f5ca7c4a0cc0f492de0157ac0c6826322e3 (patch)
tree14e9ba421ad2942c7d9e3dcf39473345b2a53075 /usr.sbin
parent352fe801dfeb83bec7068f521687c384bd935e38 (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.c6
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);