On Fri, May 20, 2011 at 06:57:18AM -0400, Ashish Jangam wrote: > Hi, > > As requested approximation of battery temperature calculation with fixed point conversion is tried but it causes couple of link time errors, like undefined reference to __aeabi_i2d at sprintf(). Have a look at the function da9052_read_tbat(); we feel that this function should not be supported else there will be a prerequisite to the support the required floating point library. Enabling FPE_NWFPE support in the kernel gives the same link time errors. > You have defined #define LOGN2 0.693147181 and use it, which makes the entire calculation a floating point calculation and defeats the purpose. The idea would have been to define something like #define CAL_LOG2(nr) ((int)((ilog2(nr) - ilog2(100)) * 693147181LL / 1000000000LL)) Also, there is no need for rounding, say, 0.003355705 to 0.0034, or 2.5 to 3. Add a few digits, like above, and remove them afterwards. x * 2.5 = x * 5 / 2. x * 33.55705 = x * 3355705 / 100000 Just be careful that you don't get overflows. Guenter _______________________________________________ lm-sensors mailing list lm-sensors@xxxxxxxxxxxxxx http://lists.lm-sensors.org/mailman/listinfo/lm-sensors