Question
In the C program, What is the difference between the functions in the math library(math.h) and those defined by yourself? Eg: We can define math.h
In the C program, What is the difference between the functions in the math library(math.h) and those defined by yourself?
Eg:
We can define math.h and use sin(x) cos(x)
Also, we can define sin(x) cos(x) by ourself which ls like
double Sin(double X) { double Result=X,Fac=1.0,Xn=X,Precious=X; int n=1,sign=1; while(Precious>1e-6) { n++; Fac=Fac*n*(++n); Xn*=X*X; sign=-sign; Precious=Xn/Fac; Result=sign>0?Result+Precious:Result-Precious; } return Result; }
So, I noticed the output is exact the same, but if there are some parts still differences between them.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started