您的位置:首页 > 其它

C PRIMER PLUS 学习笔记(一)

2014-06-18 13:22 162 查看
1显示程序执行的窗口一闪即逝。可以添加如下语句:


getchar()


作用是获取键盘输入。

2
inf
nan



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指十六进制指数格式输出。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐