c++ float能到小数点后多少位

float xiaoshu=0.0000000000000000000000000000000000000000000001;
cout<<"xiaoshu"<<xiaoshu<<endl;
double xiaoshu1=0.0000000000000000000000000000000000000000000001;
cout<<"xiaoshu1"<<xiaoshu1<<endl;

结果分别为0和11e-046

float xiaoshu=0.000000000000000000000000000000000000000000001;
cout<<"xiaoshu"<<xiaoshu<<endl;
double xiaoshu1=0.000000000000000000000000000000000000000000001;
cout<<"xiaoshu1"<<xiaoshu1<<endl;

结果分别为1.4013e-045和11e-45(前后两端代码仅差一个0)

上一篇:Scrapy爬虫框架教程(四)-- 抓取AJAX异步加载网页


下一篇:Laravel 5.5 FormRequest 自定义错误消息 postman调试时X-Requested-With设为XMLHttpRequest