m_r_butts
link
fedilink
351Y

Fuck, the title got my hopes up.

so is anything in any computer

@pixelscript@lemmy.ml
link
fedilink
English
13
edit-2
10M

The replacement for the JavaScript Date API is on the cusp of finalization.

They just got an RFC proposal approved by the IETF for an extension to the way datetime strings should be serialized that adds support for non-Gregorian calendar systems. That seems to have been the last round of red tape holding them back. Now it’s just a handful of bugfix PRs to merge and browsers can begin shipping implementations unflagged.

You can watch the progress here if you find it interesting. In the meantime, there is a polyfill out now if you want to get started with it.

If we’re still using JavaScript in the year 275,760 we deserve the resulting epoch collapse

Who knew The Cosmic AC would be running js.

Thanks, I love oddly comforting techno theology

palordrolap
link
fedilink
241Y

Bold of you to assume that humanity will even exist at that point. In fact, it’d be pretty bold to assume we’ll exist in 2757; forget those last two digits.

Big P
link
fedilink
English
251Y

I’m not even sure we’ll be existing in 2057 at this rate

mifan
link
fedilink
910M

Or even make it till 20:57

Javascript will subsume all other languages by then. Humanity won’t even know that others existed, or even what it is. It’ll just be called Script, the way you tell computers what to do when the AI doesn’t understand your prompts correctly.

📛Maven
link
fedilink
English
1310M

Epochalypse…

I’m still thinking about the 2037 problem.

Not to be that guy, but it is the 2038 problem for 32 bit epoch. Check this out: https://en.m.wikipedia.org/wiki/Year_2038_problem

But yeah, that’s a much bigger issue.

right, my bad.

StarDreamer
link
fedilink
English
1710M

No, the 2037 problem is fixing the Y2k38 problem in 2037.

Before that there’s no problem :)

@aperson@beehaw.org
link
fedilink
English
410M

2038*

@vsh@lemm.ee
link
fedilink
English
110M

This problem is now so old that hardware running it in 2038 will be obsolete

All numbers in JS are stored as 64-bit floats, so past a certain point, precision starts to degrade.

Stantana
link
fedilink
310M

Teach me why pretty pls

Well that’s how floating point units work.

The following is more a explanation about the principle than a precise description of float values in programming, since working with binary values has its own quirks, especially with values lower than one, but anyways:

Think about a number noted by a base and an exponent, like
1.000.000
can be represented as 1*10^6.

1.000.001 now becomes 1,000001*10^6.

If you want more precision or bigger numbers maintaining the same precision, you will have to add further and further decimal places and that hits a limit at a certain amount.

So basically you can either get really high numbers in a floating point unit or you can store really precise small numbers. But you cannot achieve both at the same time.

Traister101
link
fedilink
6
edit-2
10M

Alternatively as both floats (32 bit) and doubles (64 bit) are represented in binary we can directly compare them to the possible values an int (32 bit) and a long (64 bit) has. That is to say a float has the same amount of possible values as an int does (and double has the same amount of values as a long) . That’s quite a lot of values but still ultimately limited.

Since we generally use decimal numbers that look like this 1.5 or 3.14. It’s setup so the values are clustered around 0 and then every power of 2 you have half as many meaning you have high precision around zero (what you use and care about in practice) and less precision as you move towards negative infinity and positive infinity.

In essence it’s a fancy fraction that is most precise when it’s representing a small value and less precise as the value gets farther from zero

Stantana
link
fedilink
210M

Thanks!

Precision always degrades

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 120 users / day
  • 257 users / week
  • 744 users / month
  • 3.72K users / 6 months
  • 1 subscriber
  • 1.48K Posts
  • 32.7K Comments
  • Modlog