Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: "Christoph M. Becker" Newsgroups: comp.lang.javascript Subject: Re: function to get frequencies of a char array Date: Tue, 27 Jan 2015 13:55:47 +0100 Organization: solani.org Lines: 44 Message-ID: References: <26839541.MRbOrngyXZ@PointedEars.de> <87twzgl0aq.fsf@bsb.me.uk> <2697158.aGRKFDBAEn@PointedEars.de> <10619254.HIfIgzSeSj@PointedEars.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: solani.org 1422363343 12542 eJwFwQkBwEAIAzBLPKXVww7wL2FJJZ1PYBF1dSvN2lioBNgXeLvXaw89E57w6WVdSMn2HyVIEU4= (27 Jan 2015 12:55:43 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Tue, 27 Jan 2015 12:55:43 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 X-User-ID: eJwFwYkBABAMA8CV9EkwTpXsP4I7BI09k2BCkFYf9Clu0xsnhGJOl7O20uK+vLbQGPSI6x8wVREt In-Reply-To: <10619254.HIfIgzSeSj@PointedEars.de> Cancel-Lock: sha1:2v+5aPIOxHu19r/814bL6o1MsK8= X-NNTP-Posting-Host: eJwFwQEBwDAIAzBLB9oe7LCBfwlLGDKdH6LA5XabSZW3ynIplh/EAHnW0e2f6cb2uDDKeQtYELU= Xref: csiph.com comp.lang.javascript:26730 Thomas 'PointedEars' Lahn wrote: > Christoph M. Becker wrote: > >> Evertjan. wrote: >> >>> This was about a count, >>> in Javascript you cannot >>> in a single variable >>> count from 0 to 1e32 >>> for reasons of […] resolution. >> >> […] >> However, I don't understand what you mean by "resolution". > > The largest integer that can be represented with IEEE 754 “double precision” > floating-point values as used in the ECMAScript Number type such that all > smaller integers greater than or equal to ±0 can be represented exactly, is > 2⁵³ = 9'007'199'254'740'992 (the mantissa has 52 bits and the leading 1 is > implied.) Implementations of ECMAScript Ed. 6 are going to make that value > available with the *successor* of the value of the Number.MAX_SAFE_INTEGER > property: > > > p. > > The aforementioned values are approximately 9 × 10¹⁵ ≪ 10³². Thanks for the explanation. Actually, I screwed up again, as I meant 2³² (not 10³²), which can be represented exactly as integer, but doesn't "survive" the ToInt32() call. Even 2³¹ does not: Math.pow(2, 31) | 0 // => -2147483648 As we were talking about array *indexes*[1], values equal to or beyond 2³² are irrelevant, anyway. [1] -- Christoph M. Becker