- Ephera ( @Ephera@lemmy.ml ) 4•2 years ago
…but why? This looks like it would never be expected behavior. Like a bug in the implementation, which can simply be fixed.
- Ephera ( @Ephera@lemmy.ml ) 9•2 years ago
Oh no, it’s even documented on MDN:
- enebe ( @enebe@lemmy.ml ) 2•2 years ago
Sweet Flying Spaghetti Monster, that’s horrible. I’m guessing the reason is to keep the truth value equivalent when casting to boolean, but there has to be a more elegant way…
- Ephera ( @Ephera@lemmy.ml ) 2•2 years ago
Might be, but this is also a decent explanation: https://lemmy.ml/post/464637/comment/272066
- brombek ( @brombek@lemmy.ml ) 4•2 years ago
It amazes me that people write financial software in JS. What can possibly go wrong :D
- Arthur Besse ( @cypherpunks@lemmy.ml ) 3•2 years ago
2**53 + 1 == 2**53
- thervingi ( @thervingi@lemmy.ml ) 2•2 years ago
Javascript in a nutshell
- AgreeableLandscape ( @AgreeableLandscape@lemmy.ml ) 2•2 years ago
Technically, the top and bottom lines on classical math approach 1 and 0, like limits.
- Ephera ( @Ephera@lemmy.ml ) 3•2 years ago
As far as I’m aware, there’s actually no consensus on what’s technically correct.
Some will argue that they don’t approach these values, because you’re not saying
lim x from 0 to ∞, where x is the number of '9'-digits
. Instead, you’re saying that the number of digits is already infinite right now.
- JPAKx4 ( @JPAKx4@lemmy.sdf.org ) 2•9 months ago
And it works properly if you change it from a float to a strong first! JavaScript 🥰