首页 > 编程语言 > 详细

c++ float 带 e 的指数

时间:2016-06-26 06:56:18      阅读:271      评论:0      收藏:0      [点我收藏+]

带e是指10的 e后面次方 

#include <iostream>
int main()
{
    float f;
    f = 9.87654321f;
    std::cout << f << std::endl;
    f = 987.654321f;
    std::cout << f << std::endl;
    f = 987654.321f;
    std::cout << f << std::endl;
    f = 9876543.21f;
    std::cout << f << std::endl;
    f = 0.0000987654321f;
    std::cout << f << std::endl;
    return 0;
}

输出:

9.87654
987.654
987654
9.87654e+006
9.87654e-005

c++ float 带 e 的指数

原文:http://www.cnblogs.com/zhangdongsheng/p/5617241.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!