Javascript - What is the maximum number in scientific notation is limited?

In JavaScript, I was curious to know what possible maximum number can be represented in scientific notation without finally getting "Infinity", so I wrote a small program and recognized it

17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669288791094655554785194040263065748867150582068190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779

which can be reduced to 1.7976931348623157e + 308.

My question is: what makes this particular number the maximum possible in JavaScript? Is it hardware-dependent (possibly 64 bit maximum?) Or language specific? Why exactly 308 maximum net power of 10?

And also, how different is it from other languages?

+4
source share
1 answer

:
. - , .

:

(double - float ) : . , , : 1.34 * 10 ^ 24 1,34, - 24.

https://en.wikipedia.org/wiki/Double-precision_floating-point_format

Number.MAX_VALUE

Number.MAX_VALUE Number, 1.7976931348623157e + 308.

{ [[Writable]]: false, [[Enumerable]]: fafalselse, [[Configurable]]: false }.

http://ecma262-5.com/ELS5_HTML.htm#Section_8.5

( ), , , . binary format double point double precision: binary64

10 , -1023 +1024.

10, 2. 8 ( ) 11 ( ), , -127 +128 () -1023 +1024 ().

2 ^ 1024 1.797693134862315907729305190789 * 10 ^ 308, .

+6

Source: https://habr.com/ru/post/1678237/


All Articles