URL: <https://savannah.gnu.org/bugs/?65449>
Summary: Precision of energy measurement thrown away by printing insufficient decimal places. Group: GNU FreeIPMI Submitter: None Submitted: Mon 11 Mar 2024 02:25:27 PM UTC Category: ipmi-oem Severity: 3 - Normal Priority: 5 - Normal Item Group: User Interface Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Operating System: GNU/Linux _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Mon 11 Mar 2024 02:25:27 PM UTC By: Anonymous ipmi-oem/ipmi-oem-dell.c reads the cumulative energy as an integer in Wh (sored in uint32_t cumulative_reading;) and then divides by 1000 to get kWh (stored in double cumulative_reading_val;). Later the printf statement only prints 2 decimal places when clearly there are 3 decimal places that are valid. It is a great shame that the precision of the raw reading is being degraded by an order of magnitude. Unless I have missed something then there is no need to throw away this precision in the measurement and I have a use case where this extra precision is needed. Please find attached a patch to fix the print formatting of the cumulative energy reading in pmi-oem/ipmi-oem-dell.c . Regards Alex Owen r.a.owen -AT- qmul.ac.uk _______________________________________________________ File Attachments: [PATCH] freeipmi-oem-dell-energy-precision.patch ------------------------------------------------------- Name: freeipmi-oem-dell-energy-precision.patch Size: 566B <http://savannah.gnu.org/bugs/download.php?file_id=55824> AGPL NOTICE These attachments are served by Savane. You can download the corresponding source code of Savane at https://git.savannah.nongnu.org/cgit/administration/savane.git/snapshot/savane-f95530753e974ac1d60f8c0c697f148099475f1a.tar.gz _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?65449> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/