Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #34264
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Measuring time (was: Random numbers) |
| Date | 2017-10-30 13:00 +0100 |
| Organization | PointedEars Software (PES) |
| Message-ID | <5322825.lOV4Wx5bFT@PointedEars.de> (permalink) |
| References | (7 earlier) <kt73vcpiuul20rm04b0pmf7d1ontqc6q04@4ax.com> <4045820.LvFx2qVVIh@PointedEars.de> <c2944012-e18e-41ed-be01-8eafeb76f495@googlegroups.com> <5089967.DvuYhMxLoT@PointedEars.de> <17d154a1-bc7d-402c-8656-9c48d69d6816@googlegroups.com> |
dr.j.r.stockton@gmail.com wrote:
> On Sunday, 29 October 2017 16:56:30 UTC, Thomas 'PointedEars' Lahn wrote:
>> Dr J R Stockton wrote:
>> > there was no 1900-02-29.
>>
>> | -> new Date(0, 0, 1)
>> | <- Mon Jan 01 1900 00:00:00 GMT+0100 (CET)
>> |
>> | -> new Date(0, 1, 29)
>> | <- Thu Mar 01 1900 00:00:00 GMT+0100 (CET)
>
> I prefer to rely on common knowledge of the Gregorian Reform;
> IIRC, the 4/100/400-year rules were printed on the back
> cover of school exercise books in my day.
>
> But I suggest that section 9 of
> <http://www.thelatinlibrary.com/gravissimas.html> is more
> authoritative than relying on software.
ISTM that you have not read my posting(s) carefully enough. The
implementation confirms your claim that there was no 1900-02-29 CE,
which disproves your claim that
>>> There is only one such date; there was no 1900-02-29.
in reply to my
>> AFAICS, the result for [new Date(0, 1, N)] is only wrong (not as
>> specified) if N < 366 and one expects a date that is not in 1900 CE.
which I have explained how it was meant.
>> > But the following code yields merely 59 :-
>> > S = ""
>> > for (N=1 ; N<400 ; N++) {
>> > D1 = new Date(0e3, 0, N).getDate()
>> > D2 = new Date(2e3, 0, N).getDate()
>>
>> Undeclared variable, unwise identifiers.
>
> Irrelevant; single-use code, not saved to disc.
Examples posted here should meeet the minimum standards of recommendable
ECMAScript code.
>> > S += "+" + +(D1==D2) }
>>
>> An Array instance is a lot more efficient for this:
>
> No; it would take longer to type,
It would not.
> and I had wanted to see S in its full glory before completion.
You do not have to see it as a *string* value.
> Execution was effectively instantaneous.
Addition is available directly as I showed, and indirectly through the
Array.prototype.reduce() method. There is no need for inefficient
concatenation or evil eval() [tm].
var a = Array.apply(null, {length: 10}).map((e, i) => i);
/* [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] */
console.log(a);
var notGauss = a.reduce((accu, e) => accu + e);
/* 45 */
console.log(notGauss);
>> > In a normal year, January+February is 59 days; the rest are wrong.
>> I do not see your point.
>
> Then think more deeply.
Likewise.
> Looking at S may help you.
It would not.
--
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Random numbers emf <emfril@gmail.com> - 2017-10-19 07:35 -0400
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-19 05:03 -0700
Re: Random numbers Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-19 21:06 +0200
Re: Random numbers "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-10-19 12:10 -0700
Re: Random numbers Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-19 22:04 +0200
Re: Random numbers "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-10-19 13:41 -0700
Measuring time (was: Random numbers) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-19 22:58 +0200
Re: Measuring time (was: Random numbers) Dr J R Stockton <J.R.Stockton@physics.org> - 2017-10-24 13:05 -0700
Re: Measuring time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-25 00:59 +0200
Re: Measuring time Dr J R Stockton <J.R.Stockton@physics.org> - 2017-10-25 13:36 -0700
Re: Measuring time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-26 19:21 +0200
Re: Measuring time (was: Random numbers) Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2017-10-26 10:45 +0200
Re: Measuring time (was: Random numbers) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-10-26 12:27 +0200
Re: Measuring time (was: Random numbers) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-26 19:04 +0200
Re: Measuring time (was: Random numbers) Hans-Georg Michna <hans-georg@michna.com> - 2017-10-28 11:05 +0200
Re: Measuring time (was: Random numbers) Dr J R Stockton <J.R.Stockton@physics.org> - 2017-10-29 03:03 -0700
Re: Measuring time (was: Random numbers) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-29 17:56 +0100
Re: Measuring time (was: Random numbers) dr.j.r.stockton@gmail.com - 2017-10-29 15:12 -0700
Re: Measuring time Sam E <why.should.this@be.email.invalid> - 2017-10-29 17:35 -0500
Re: Measuring time (was: Random numbers) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-30 13:00 +0100
Re: Measuring time (was: Random numbers) Tim Slattery <tim@risingdove.com> - 2017-10-26 14:13 -0400
Re: Random numbers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-10-19 22:21 +0100
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-19 22:25 -0700
Re: Random numbers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-10-20 21:52 -0700
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-20 22:40 -0700
Re: Random numbers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-10-21 12:40 -0700
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-21 12:57 -0700
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-21 12:59 -0700
Re: Random numbers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-10-22 16:37 -0700
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-22 17:23 -0700
Re: Random numbers emf <emfril@gmail.com> - 2017-10-20 20:32 -0400
Re: Random numbers "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-10-21 09:47 -0700
Re: Random numbers emf <emfril@gmail.com> - 2017-10-22 14:55 -0400
Re: Random numbers emf <emfril@gmail.com> - 2017-10-27 22:23 -0400
Re: Random numbers Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-28 18:54 +0200
csiph-web