C sqrt() 함수
거듭제곱 값을 구합니다.
- 헤더: math.h
- 형태: double sqrt( double x)
- 인수: double x 제곱근을 구하려는 값
- 반환: double x의 제곱근
변수 타입별 함수 목록입니다.
변수 타입 | 함수 | 헤더 파일 |
double | sqrt( double x) | math.h |
float | sqrtf( float x) | math.h |
long double | sqrtl( long double x) | math.h |
C언어 sqrt() 함수 예제
#include <stdio.h>
#include <math.h>
int main( void)
{
double x = 2.2;
printf( "%g\n", sqrt( x));
return 0;
}
C언어 sqrt() 예제 실행 결과
]$ ./a.out
1.48324
]$
'컴퓨터 > 프로그래밍' 카테고리의 다른 글
C언어 sin 함수 sin() (0) | 2020.03.13 |
---|---|
C언어 제곱 계산 함수 pow() (0) | 2020.03.13 |
C언어 난수 seed 지정 함수 srand() (0) | 2020.03.13 |