码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2016-07-12 15:08:10      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

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)

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

标签:

原文地址:http://www.cnblogs.com/halosus/p/5663465.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!