C PRIMER PLUS 学习笔记(一)

1显示程序执行的窗口一闪即逝。可以添加如下语句:

getchar()

作用是获取键盘输入。


2 infnan

float toobig = 3.4e38 * 100.0f;
float not_a_number = asin(1.2);//math.h
printf("%e \t %e\n", toobig,not_a_number);

inf-表示无穷大,nan-Not-a-number


3 long double 的输出格式

long double x;
x = 3.2e-5;
printf("x = %f, x = %e\n", x, x);
printf("x = %lf, x = %le\n", x, x);
printf("x = %Lf, x = %Le\n", x, x);

long double 应采用%Lf(%lf)或者%Le(%le)或者%La(%la)
%a指十六进制指数格式输出。


 

posted @ 2014-06-18 13:22  liuxia_hust  阅读(224)  评论(0编辑  收藏  举报