c++ float 带 e 的指数

带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
posted @ 2016-06-26 02:32  瓜蛋  阅读(4299)  评论(0编辑  收藏  举报