更新MD文件路径引用
- 修正主README.md中的所有路径引用,使其与当前文件结构一致 - 更新翁凯C语言学习指南链接路径 - 更新五子棋AI项目文档链接路径 - 更新数据结构学习文档链接路径 - 修正编译说明和学习模块使用指南中的目录路径 - 改进五子棋README.md的编译运行说明,增加Windows和Linux/macOS的分平台指导 - 确保所有文档链接和路径引用都能正确工作
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
// !浮点数的范围
|
||||
printf("%f\n", 12.0/0.0); //12/0是没有定义的,即只有浮点数有无穷大和无穷小
|
||||
printf("%f\n", -12.0/0.0);
|
||||
printf("%f\n", 0.0/0.0);
|
||||
//inf是无穷大,nan是无穷小
|
||||
|
||||
// !浮点数的精度
|
||||
float a, b, c;
|
||||
a = 1.345f; //带小数点的默认是double类型,所以要加f来指定是float类型
|
||||
b = 1.123f;
|
||||
c = a + b;
|
||||
if (c== 2.468)
|
||||
{
|
||||
printf("c = 2.468\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("不相等! c=%.10f,或%f\n", c, c);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user