2026-11-14 17:14 UTC
Replies (17)
-
@Quetzalcutlass@lemmy.world 2026-11-14 17:19
Numbn’t.
-
@SrMono@feddit.org 2026-11-14 17:36
youtu.be/et8xNAc2ic8
-
@ThunderComplex@lemmy.today 2026-11-14 17:38
I think this, and the fact that NaN == NaN is false, make perfect sense. NaN is the result of mathematically undefined behavior. You’re not going to get a NaN outside of a number context, so tying it together in the Number scope is fine.
-
@bigmclargehuge@lemmy.zip 2026-11-14 17:53
The way I think about it: number is a js type. A floating point double, in other languages. NaN is a state that a number type can be in, representing a situation where the outcome of the numeric operation cannot be determined. Anywho, also yea ….JavaScript is goofy
-
@palordrolap@fedia.io 2026-11-14 18:19
Infinity is also a number in JavaScript / IEEE number formats, but you'll get a lot of grumbling from mathematicians with that sort of assertion.
-
@bss03@infosec.pub 2026-11-14 18:35
www.destroyallsoftware.com/talks/wat is much better. This post is pretty low-effort.
-
@Colloidal@programming.dev 2026-11-14 20:28
It’s clearly bread.
-
@Jankatarch@lemmy.world 2026-11-14 21:32
> “Not a number” > Look inside > Number.
-
@TrickDacy@lemmy.world 2026-11-14 23:00
JavaScript really isn’t as bad as people want it to be
-
@thethunderwolf@lemmy.dbzer0.com 2026-11-15 03:44
this makes sense NaN is a “this was meant to be a number but it somehow isnt”
-
@dylanTheDeveloper@lemmy.world 2026-11-15 05:18
Technically everything is a number when you get low enough
-
@b3nsn0w@lemmy.world 2026-11-15 05:35
duh, it’s part of the IEEE 754 standard. every language that handles floating point numbers has NaN handling, and in every language NaN is a float. the only reason this is brought up as a javascript thing all the time is that js doesn’t have separate float and int types (aside from special structures like typed arrays and dataviews), it just defaults to float64 for simplicity and calls it number, which lines up with the “NaN is a number? nani???” joke. you don’t like it? consult the sorry excuse of thinking sand in the device you’re reading this on, because this is etched straight into it. every FPU capable of handling float32 and float64 numbers knows what NaN is and handles it the exact same way. this is one of the many things that sound unintuitive about programming but if you bother to understand the context you realise that if it wasn’t this way, it would be way worse. one of the most important skills in our field is to understand computers for what they are, rather than be puzzled that they aren’t what you thought they were, and it especially comes out in edge cases like this.
-
@General_Effort@lemmy.world 2026-11-15 14:04
It is the number that must not be; that cannot be. These 3 letters are all that stand between you and the ultimate cosmic horror. It is not for nothing that the sender of eight is also known as the soul-render. Which is why a sensible wizard will never mention the number if they can avoid it. “Or you’ll be eight alive.”
-
@baramintal@lemmy.org 2026-11-15 14:18
The beauty of JavaScript. You probably haven’t encountered truthsy and falsy values yet?
-
@ChickenLadyLovesLife@lemmy.world 2026-11-15 17:14
Stop calling it “NaN bread” – NaN is fucking bread!
-
@Everyday0764@lemmy.zip 2026-11-15 18:30
there is a game / challenge for this
-
@Kolanaki@pawb.social 2026-11-16 01:48
I’ve never had number naan before… Is it any good? 🤔