From e756865491ad951b9c497b02eae9cc39071765ab Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 20 Jun 2023 17:43:02 +0300 Subject: [PATCH] more on numbers... Signed-off-by: Alex A. Naanou --- js-types-n-oop.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/js-types-n-oop.js b/js-types-n-oop.js index d3af001..0693005 100755 --- a/js-types-n-oop.js +++ b/js-types-n-oop.js @@ -71,7 +71,22 @@ // - precision, rounding errors and fractions (IEEE-754) 0.1 + 0.2 == 0.3 // -> false +// XXX + // - large number rounding + Number.MAX_SAFE_INTEGER + 10 - 10 == Number.MAX_SAFE_INTEGER + +// In general numbers larger than Number.MAX_SAFE_INTEGER and +// smaller than Number.MIN_SAFE_INTEGER should not be used for +// math operations (see BigInt). +// +// Note that neither issue is specific to JavaScript but rather are +// side-effects of number implementations in modern computers and +// the trade-offs of these implementation on each level from the +// CPU to the high-level languages. +// +// For more details see: +// XXX // Strings