summaryrefslogtreecommitdiffstats
path: root/sysfs
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-11-11 12:55:14 -0800
committerPatrick Venture <venture@google.com>2018-11-11 12:57:02 -0800
commit5f59c0fdbda807ac54a58657fbd6cbde718e8678 (patch)
tree8934e1a3e91c2281f4a306419a9c53a77f471ad9 /sysfs
parentba3c8c1c15ab10e3c9ad287c93d8a7598addc22f (diff)
downloadphosphor-pid-control-5f59c0fdbda807ac54a58657fbd6cbde718e8678.tar.gz
phosphor-pid-control-5f59c0fdbda807ac54a58657fbd6cbde718e8678.zip
Move all floats to doubles
The code was developed initially around a pid loop implemented using floats. Therefore, the code was converting back and forth between double for sensor values as inputs and outputs from this PID loop. Change-Id: I2d2919e1165103040729c9f16bb84fde3dd6b81b Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'sysfs')
-rw-r--r--sysfs/sysfswrite.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/sysfs/sysfswrite.cpp b/sysfs/sysfswrite.cpp
index 1ea4c4d..6ca9b25 100644
--- a/sysfs/sysfswrite.cpp
+++ b/sysfs/sysfswrite.cpp
@@ -21,12 +21,12 @@
void SysFsWritePercent::write(double value)
{
- float minimum = getMin();
- float maximum = getMax();
+ double minimum = getMin();
+ double maximum = getMax();
- float range = maximum - minimum;
- float offset = range * value;
- float ovalue = offset + minimum;
+ double range = maximum - minimum;
+ double offset = range * value;
+ double ovalue = offset + minimum;
std::ofstream ofs;
ofs.open(_writepath);
OpenPOWER on IntegriCloud