开发者

How to get completely accurate values in JavaScript? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Huge Integer JavaScript Library

Suppose I want the exact value for 2^1000. How am I supposed to get the entire value? Maybe storing it in a string every time the multiplication is done, but it will still eventually go over 10 digits! Is there any way, or开发者_JS百科 does ECMAScript just not support this?


Math.pow(2,1000)

returns

1.0715086071862673e+301

how accurate do you need this to be?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜