- 1 Post
- 2 Comments
Joined 2 years ago
Cake day: July 23rd, 2023
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
UnknownFryingObject@feddit.deto Programmer Humor@lemmy.ml•JavaScript's days are numbered13·2 years agoWell 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 as1*10^6
.1.000.001
now becomes1,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.
Heather Net should better go back to her networking course.