How do people deal with floating point inaccuracy in ANSI C? In this case, there is an expected result of 4.305, but ANSI C returns an additional 0.000001?
#include<stdio.h>
main()
{
float _lcl1=66.3;
float _ucl1=76;
float lbl1 = 0;
float ubl1 = 0;
lbl1 = (_lcl1 - 2.5 * (_ucl1 - _lcl1));
printf ("%e\n",lbl1);
}
4.205001e+01
Ideas I have are that this must be a common issue so there is a standard lib to deal with this or people convert these to integers, do the calculation, and then convert them back? Can someone provide some insight on a successful "in practice" strategy?