Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: Sort at least 5 times faster then native and quicksort Date: Sun, 29 Oct 2017 14:37:21 +0000 Organization: A noiseless patient Spider Lines: 26 Message-ID: <87tvyit3z2.fsf@bsb.me.uk> References: <8c8816a1-0e4f-4bb4-8a52-94f434e4d599@googlegroups.com> <87d156upbm.fsf@bsb.me.uk> <27cc47e1-2ed9-4e79-84e8-923454a7cff5@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="b252f5705e435813dbfff633d4cae81b"; logging-data="9422"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18R7qNRh9sxkB5d5uu0anDsm4+ZVmkuX3U=" Cancel-Lock: sha1:zzgy3GljasONfr8S2tQWoT47OnY= sha1:hVaWHyWuXmgRd0g4px5JMdRK0Dg= Xref: csiph.com comp.lang.javascript:34235 jonas.thornvall@gmail.com writes: > Den söndag 29 oktober 2017 kl. 13:10:59 UTC+1 skrev Ben Bacarisse: >> jonas.thornvall@gmail.com writes: >> > But usual there is some weird aspect i can't find out what i do wrong, >> > if you set startrange for the random numbergererator higher then 0 >> > values will turn up undefined i don't get it. >> >> You don't zero the right number of elements in countval. This, in turn, >> is because you do >> >> number=Math.floor(Math.random() * end) + start; >> >> so the numbers range from start to start+end-1. > Can you understand the bug that occur when the sample range start is > not zero Ben? Yes. What did you not understand in the explanation? (Please try trimming quoted material in your posts.) -- Ben.