|
Dunno, I'll ask my mummy!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
Prolly someone with "zombie in your head".
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I Kuntz reply mon, ah not be King but I do Love 'te craft...
Software Zen: delete this;
|
|
|
|
|
Not if he's been encrypted...
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Surely it's the decrypted ones you need to worry about...
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
Hi,
Has anyone else done this, looked at a bit of code written many moons ago and thought "How the did I do that, why did I do that?" I was just hunting around for a standards doc to check something when I found an old C# answer to someones homework I might have written. I think the question was about using an array to store and calcualte Fibbonanci numbers (1+1=2, 2+1=3, etc) the answer was using no arrays and would only got 93. Does anyone recongnise this:
double sqrt5 = Math.Sqrt(5);
double phi = (sqrt5 + 1) / 2;
return Convert.ToUInt64((1 / sqrt5) * Math.Pow(phi, n));
It doesn't resemble my code.
|
|
|
|
|
Google does: series - Fibonacci in C# | DaniWeb[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Quote: Has anyone else done this, looked at a bit of code written many moons ago and thought "How the 🐘 did I do that, why did I do that?" Forget many moons ago; it's happened the next day after writing code despite having had too much wine.
|
|
|
|
|
It's a variation of Binet's formula - assuming Convert.ToUInt64 rounds rather than truncates:
Fibonacci number - Wikipedia[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
As per Wikipedia:
The main advantage of a decimal time system is that, since the base used to divide the time is the same as the one used to represent it, the whole time representation can be handled as a single string. Therefore, it becomes simpler to interpret a timestamp and to perform conversions. For instance, 1:23:45 is 1 decimal hour and 23 decimal minutes and 45 decimal seconds, or 1.2345 decimal hours, or 123.45 decimal minutes or 12345 decimal seconds; 3 hours is 300 minutes or 30,000 seconds. This property also makes it straightforward to represent a timestamp as a fractional day, so that 2021-04-06.54321 can be interpreted as five decimal hours and 43 decimal minutes and 21 decimal seconds after the start of that day, or a fraction of 0.54321 (54.321%) through that day (which is shortly after traditional 13:00). It also adjusts well to digital time representation using epochs, in that the internal time representation can be used directly both for computation and for user-facing display.
Decimal time - Wikipedia[^]
Decimal calendar - Wikipedia[^]
|
|
|
|
|
Or ... How Do 'Star Trek' Stardates Work?[^] which would be a lot easier to push to some segments of the population ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
More proof that "good enough" is.
|
|
|
|
|
So, how do we digitize military time:
"Mickey's big hand is between the 10 and 11 and his little hand is on the 6?"
If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.
|
|
|
|
|
Easy. Like everything else in the army, do it by threes.
Trinary time!
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
|
I wasn't aware of these proposals. Decimal time makes sense. Decimal calendar, no. But...inertia.
|
|
|
|
|
The major problem with all of our natural timekeeping systems is that the "constants" on which they rely (day, year) are neither integral multiples of each other nor truly constant. This is why the time base for highly-accurate time measurements is TAI (International Atomic Time), determined by a set of ~400 atomic clocks worldwide. This is basically a count of seconds from an agreed base, and could in principle be converted to any other representation.
For atavistic reasons, humans like to have calendars and clocks that match the astronomical phenomena. In the northern hemisphere, we expect spring to start in March/April, autumn in September/October, etc. We also expect the year to have a whole number of days*. We therefore have such strictly-unnecessary phenomena as "leap seconds" and "leap years" to keep everything aligned, giving us UT1.
Given the above constraints, it would be impossible to design any calendar that did not make allowances for irregularities in the count. As such, we may as well remain with what most people feel comfortable.
* Months are artificial constructs in the civil calendar, so I'm not mentioning them
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
What do we do for those with a different number of fingers?
If a conversion is necessary, so long as we use binary for computers then we ought use a binary-compatible time: octyl or hex .
I mean, really, base ten is a commonly used custom but is really pretty stupid as choices go.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
W∴ Balboos, GHB wrote: What do we do for those with a different number of fingers?
We use base 10.. duh!
|
|
|
|
|
+ !
And that's why you have more reputation points than I .
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Member 12924312 wrote: the whole time representation can be handled as a single string Yes, meaning it'd be slower than the current float that's used when trying to mutate.
Also, if we are changing anyway, why not pick something like Swatch Internet Time - Wikipedia[^]?
I'd already be happy if they stopped with summer&winter time
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
The 'nice' thing about the current system is that 24 and 60 are divisible by a lot of numbers making it easier to calculate fractions of days, hours and minutes. I don't know how Siri would respond to setting a timer for 33.333333... minutes.
"Time flies like an arrow. Fruit flies like a banana."
|
|
|
|
|
Also, you can make the major divisions on a circular clock face with a compass.
"Time flies like an arrow. Fruit flies like a banana."
|
|
|
|
|