undefined
adjective
- Lacking a definition or value
- (mathematics) That does not have a meaning and is thus not assigned an interpretation
Saying that 1 divided by 0 is undefined, does not mean that you can carry out the division and that the result is some strange entity with the property “undefined”, but simply that dividing 1 by 0 has no defined meaning. That is just like when you ask whether the number 1.9 is odd or even: That is not defined. Or when you ask what colour the number 7 has.
Answer from Carsten S on Stack ExchangeProbably a trivial question, but it's been bugging me lately.
Most of us learn in school that 1÷0 is "undefined", but usually the teacher doesn't go much further than that. I've taken it to mean that dividing by zero is an operation that is not defined in standard mathematics, i.e. the answer to 1÷0 is not defined. However, I've seen people (both students and teachers) talk about "undefined" as though it's a mathmatecal term in of itself. Is this proper usage of the term, or does it simply mean that something is not defined?
tl;dr -- When discussing division by zero, is "undefined" a noun or an adjetive?
terminology - What does the term "undefined" actually mean? - Mathematics Stack Exchange
WDP put the word "undefined" at the end of their posts?
Fwiw, that comment doesn't appear to say undefined now:
If you want to make sure you understand something, try to explain it out loud to a rubber duck.
(Not kidding.)
Edit: Y'all, I'm a programmer. I know the origins. But it's useful in learning anything - not just debugging!
https://www.reddit.com/r/AskReddit/comments/lum9el/comment/gp8b4kv
Would need to see some more examples to try and derive a pattern, and I don't really understand what I'm looking at in your screenshot or what the connection is to YouTube, but based on that sample of one I'm wondering if the undefined somehow crept in when the original comment was updated?
Edit: Ok, I worked out what the screenshot is showing and oh my god do I hate those videos with a passion. But I digress. My updated guess is that they're using an API to access the comments and automatically create the videos, and that the API can't cope with edited comments and outputs "undefined" instead. Or they're scraping the website instead of using an API, but in that case it's harder to imagine why it can't successfully scrape an edited comment.
At any rate, it seems like it's probably reasonable to assume this is a coding error somewhere along the way, probably related to edited comments, and not something comment/post authors are doing themselves.
More on reddit.comWhat are the idiomatic ways of using undefined and null?
There are many things that you can do with undefined and null. I recommend reading about them on MDN here (for null) and here (for undefined).
One difference I had to work with recently was the behavior when using JSON.stringify:
let fooUndefined = { foo: undefined };
let fooNull = { foo: null };
console.log(JSON.stringify(fooUndefined));
console.log(JSON.stringify(fooNull));The output:
{}
{"foo":null}As you said, it does come down to the difference between not being defined (undefined) and having it defined as nothing (null). There are many times this comes up!
Another difference is with typeof:
> typeof undefined 'undefined' > typeof null 'object'
If you're curious, I once wrote a blog post on typeof null. It's a sneaky bug from the original implementation of JavaScript!
More on reddit.comWhat does it mean when you click on a users profile and it shows u/undefined and not theirs?
They are shadowbanned?
More on reddit.comVideos
Saying that 1 divided by 0 is undefined, does not mean that you can carry out the division and that the result is some strange entity with the property “undefined”, but simply that dividing 1 by 0 has no defined meaning. That is just like when you ask whether the number 1.9 is odd or even: That is not defined. Or when you ask what colour the number 7 has.
To put matters straight: Division is a function
whereby
is the unique number
such that
.
When we say that is undefined then this means no more and no less than that the pair
is not in the domain of the function
.
Now to your three ways of understanding "undefined" in the realm of division by :
If
could be any number, say
, then this would enforce
, which is wrong when
.
This is even worse. Why should
be the Eiffel tower?
There are circumstances where division by zero makes sense, e.g. in connection with maps of the Riemann sphere, or with meromorphic functions. There one has
as an additional point in the universe of discourse. But these circumstances require special exception handling measures, and the "usual rules of algebra" are not valid when dealing with
.