I need to use ln function to read NTC sensor readings. if i use log(number , 2.71828182846) which yields to ln(number). but log function giving wrong value. Could you please tell how to log function in this controller.
The CodeWarriror IDE help says:
double log (double x);
float logf(float x);
log() computes the natural logarithm of x.
ln(x), if x is greater than zero. If x is smaller then zero, NAN is returned; if it is equal to zero, log() returns negative infinity. In both cases, errno is set to EDOM.
So you should be sure:
volatile float y;
for ( a=100; a<10000; a+=100)
y = logf( a );
A full example project is attached.
Retrieving data ...