Js in bits - 5.2(datatypes - BigInt)

  • Автор темы Автор темы Lomanu4
  • Дата начала Дата начала

Lomanu4

Команда форума
Администратор
Ofline
Learning js should be fun. It is fun if it's easy.
I tried my best in writing this, to understand it easily.

datatypes

BigInt

There are very large numbers like 9007199254740995(2^53) and Js can't store them using Number data type.

Image description

If we do the following calculation, Js stores the approx value.
Below, 1 is added & Js can't store the result with Number datatype.

Image description

Solution: BigInt

Adding n to the end of the number tells Js that it is a BigInt datatype. Js can successfully store the very large number.

Image description

Leave y'r thoughts....

Читать далее...
 
Назад
Сверху Снизу