Hi,
The CodeWarriror IDE help says:
#include <math.h>
double log (double x);
float logf(float x);
Description
log() computes the natural logarithm of x.
Return
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:
- The function uses correct types.
- You have included math.h. and you have used correct function logf, log.
- You have opened project with floating point arithmetics support. (ansib.lib should be visible in the Libs directory in project window)
#include <hidef.h>
#include "derivative.h"
#include <math.h>
int a;
volatile float y;
void main(void)
{
for(;;)
{
for ( a=100; a<10000; a+=100)
{
y = logf( a );
asm nop;
}
}
}
A full example project is attached.
Best regards,
Ladislav