C/C++ 언어 math() 함수


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <math.h>
 
void main(void) { 
  int x = 9 ;
  float pi = 3.141592 ;
 
  printf("exp(%d) = %f\n", x, exp(x));
  printf("log(%d) = %f\n", x, log(x));
  printf("log10(%d) = %f\n", x, log10(x));
  printf("pow(4,2.29) = %f\n", pow(4,2.29));
  printf("sqrt(%d) = %f\n", x, sqrt(x));
  printf("sin(%f) = %f\n", pi, sin(pi));
  printf("cos(%f) = %f\n", pi, cos(pi));
  printf("tan(%f) = %f\n", pi, tan(pi));
  printf("asin(1) = %f\n", asin(1));
cs


C/C++ 언어 math() 함수


+ Recent posts