Correct calculations of IPMI coefficient math

Massively refactored and improved
Using rounding, instead of truncation
Mantissa as large as possible, for best precision
Normalizing for consistent results
Documenting, in comments, some of the magic that is done
Now works correctly, for narrow ranges with large bias away from zero
Now works correctly, for negative numbers and signed ranges
Clamps values slightly out of range, instead of erroring

Matching update test cases to reflect new coefficient choices

Now generates output in a human-readable table
Adding function from ipmitool for round-trip testing
Testing 5 points within byte range for each value range
Now handles both signed and unsigned
Added many more value ranges that were recommended to me
Changing some exponent values to reflect new choices
Changing some mantissa values because now rounding not truncation
The close range large bias test now succeeds instead of fails

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: I2ceaef581b1270ef19be97940dbab3b588f5768d
2 files changed