How do I avoid scientific notation for large numbers?

后端 未结 8 1192
Happy的楠姐
Happy的楠姐 2020-12-15 05:04

I am doing 2^1000 and I am getting this:

1.07151e+301

Is there any way to actually turn this into a proper number without the e+301, or at least can anyone s

8条回答
  •  佛祖请我去吃肉
    2020-12-15 05:54

    You are getting as precise a number as the variable type can support. That number is on the order of 1 followed by 301 zeroes. To get a precise number you'll have to work with a library that supports large numbers, or work with a language that is made for that kind of math (maple, matlab, etc)

提交回复
热议问题