printf() 관련 질문입니다.
글쓴이: neon20 / 작성시간: 화, 2005/11/08 - 4:59오전
#include<stdio.h>
#include<math.h>
int main(){
double sq,p;
sq = sqrt((double)9);
p = pow(5,2);
printf("sq = %g, p = %g\n",sq,p);
return 0;
}예상 결과 : sq = 3, p = 25 인데 답은 엉뚱하게
실제 결과 : sq = 5.4163e-315, p = 5.30758e-315 이렇게 나오네요.
이유가 뭔가요..ㅜㅜ? 참고로 현재 리눅스 서버에서 컴파일 중입니다.
Forums:


[code:1][kernuts@localhost work]
저 소스 그대로 했는데 제대로 나오네요...
The knowledge belongs to the World like Shakespear's and Asprin.
댓글 달기