Hi, @Batorek
sin( )
is a function: _Check_return_ double __cdecl sin(_In_ double _X);
You could also try to write sin().
For example:
#include<iostream>
#include<math.h>
double MySin(double x)
{
double s, t;
int n;
t = x; n = 1; s = x;
do {
n = n + 2;
t = -t * x * x / (n - 1) / n;
s = s + t;
} while (fabs(t) >= 1e-7);
return s;
}
int main()
{
// 30°==0.52359877559829887307710723054658
std::cout << MySin(0.52359877559829887307710723054658)<<std::endl;
std::cout << sin(0.52359877559829887307710723054658)<<std::endl;
//out put :0.5
}
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.