C库函数 exp() #include <stdio.h> #include <math.h> int main () { double x = 0; printf("The exponential value of %lf is %lf\n", x, exp(x)); printf("The exponential value of %lf is %lf\n", x+1, exp(x+1)); printf("The exponential value of %lf is %lf\n", x+2, exp(x+2)); return(0); }
C库函数 sinh() #include <stdio.h> #include <math.h> int main () { double x, ret; x = 0.5; ret = sinh(x); printf("The hyperbolic sine of %lf is %lf degrees", x, ret); return(0); }
C库函数 sin() #include <stdio.h> #include <math.h> #define PI 3.14159265 int main () { double x, ret, val; x = 45.0; val = PI / 180; ret = sin(x*val); printf("The sine of %lf is %lf degrees", x, ret); return(0); }
C库函数 cosh() #include <stdio.h> #include <math.h> int main () { double x; x = 0.5; printf("The hyperbolic cosine of %lf is %lf\n", x, cosh(x)); x = 1.0; printf("The hyperbolic cosine of %lf is %lf\n", x, cosh(x)); x = 1.5; printf("The hyperbolic cosine of %lf is %lf\n", x, cosh(x)); return(0); }
C库函数 cos() #include <stdio.h> #include <math.h> #define PI 3.14159265 int main () { double x, ret, val; x = 60.0; val = PI / 180.0; ret = cos( x*val ); printf("The cosine of %lf is %lf degrees\n", x, ret); x = 90.0; val = PI / 180.0; ret = cos( x*val ); printf("The cosine of %lf is %lf degrees\n", x, ret); return(0); }
C库函数 atan2() #include <stdio.h> #include <math.h> #define PI 3.14159265 int main () { double x, y, ret, val; x = -7.0; y = 7.0; val = 180.0 / PI; ret = atan2 (y,x) * val; printf("The arc tangent of x = %lf, y = %lf ", x, y); printf("is %lf degrees\n", ret); return(0); }
C库函数 atan() #include <stdio.h> #include <math.h> #define PI 3.14159265 int main () { double x, ret, val; x = 1.0; val = 180.0 / PI; ret = atan (x) * val; printf("The arc tangent of %lf is %lf degrees", x, ret); return(0); }
C库函数 asin() #include <stdio.h> #include <math.h> #define PI 3.14159265 int main () { double x, ret, val; x = 0.9; val = 180.0 / PI; ret = asin(x) * val; printf("The arc sine of %lf is %lf degrees", x, ret); return(0); }