Hi there?
I would like to use some of math related function calls like pow, sin, sqrt...
But it seems math function doesn't work with SDK.
Either #include<math.h> on user_main or -lm on the Linker doesn't work too.
Do you have any idea to work them out?
Thanks
How to use Math related function calls?
Re: How to use Math related function calls?
Postby steve2077 » Thu Mar 26, 2015 9:16 am
I have solved some part of it by simulating the math function though, still I would like to know how to link standard math.h or math library in sdk(if available)..
Thanks..
Thanks..
Code: Select all
double pow(double x,double y)
{
double z , p=1;
//y<0 ? z=-y : z=y ;
if(y<0)
z = fabs(y);
else
z = y;
for(int i=0; i<z ; ++i)
{
p *= x;
}
if(y<0)
return 1/p;
else
return p;
}
double fabs(double x)
{
return( x<0 ? -x : x );
}
Who is online
Users browsing this forum: No registered users and 57 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.