From 79b7f7c8f0496ba5675fcd35cc631a6d7fe63848 Mon Sep 17 00:00:00 2001 From: Alexey Chilipenko <5251053+chilipenko@users.noreply.github.com> Date: Sat, 2 Jul 2022 13:36:20 +0300 Subject: [PATCH] update integers range in Data types chapter --- 1-js/02-first-steps/05-types/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/05-types/article.md b/1-js/02-first-steps/05-types/article.md index 22526cff..ba9a72a2 100644 --- a/1-js/02-first-steps/05-types/article.md +++ b/1-js/02-first-steps/05-types/article.md @@ -68,9 +68,9 @@ We'll see more about working with numbers in the chapter . ## BigInt [#bigint-type] -In JavaScript, the "number" type cannot represent integer values larger than (253-1) (that's `9007199254740991`), or less than -(253-1) for negatives. It's a technical limitation caused by their internal representation. +In JavaScript, the "number" type cannot safely represent integer values larger than (253-1) (that’s `9007199254740991`), or less than -(253-1) for negatives. Technically "number" type can store larger integers (up to 1.7976931348623157 * 10308), but outside of the safe integer range ±(253-1) a lot of integer values can't be represented using this data type: some of them are "missed" due to the limitation caused by their internal binary representation. For example, all the odd integers greater than (253-1) are "missed" in the "number" type. -For most purposes that's quite enough, but sometimes we need really big numbers, e.g. for cryptography or microsecond-precision timestamps. +For most purposes ±(253-1) range is quite enough, but sometimes we need the entire range of really big integers without missing any of them, e.g. for cryptography or microsecond-precision timestamps. `BigInt` type was recently added to the language to represent integers of arbitrary length.