Storing large decimal numbers in Java

前端 未结 4 981
离开以前
离开以前 2020-12-21 02:03

I need to store 17774132 in a double format, but it seems that double is to small since I get 1.7774132E7.

How can I overcome this problem? I need some kind of prim

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-21 02:19

    Remeber that means 1.7774132 * 10^7, so the value is represented by:

    1.7774132 * 10000000

    That's a big number, don't you think?

    Java outputs by default on scientific notation if needed. Big numbers like that are expressed in scientific notation.

提交回复
热议问题