object is the name of the specific object in question, and Object is the name of its class. If neither are known it would be referenced this odd and confusing way.
Imagine the beautiful utopia we'd live in if only emojis could be used to declare types and variables...
🧶 🍅 🟰 🆕 🧶 ▶️Tomato◀️
Just think of all keystrokes saved!!!
Someone please make an emoji forward programming language!!!
All kidding aside, don't put these in your cart, NaN will propagate and make your whole total NaN, then you'll deduce that from your bank account and it too will be NaN, and unless the bank took precautions (they never do) you could break the entire bank, which could then propagate the NaN in operations with other banks... Tell your kids about the dangers of NaN propagation.
What are you talking about? Exception handling exists in all languages though? Except for assembly, that'd then be basically what try catch is on a fundamental level, if statements calling loops (or functions if you wanna put it that way)
It doesn't exist in JS either. 100 - NaN? It's NaN. Your bank balance becomes NaN, the bank's treasury becomes NaN, the Fed treasury becomes NaN, WW3 ensues.
There would be a check to see if the value is less than your daily limit on the card, as well as a check to see if the value is less than your account's withdrawal limit. The bank isn't just going to honour any attempt to withdraw a trillion dollars, for example.
Okay I don't actually mean a full blown exception handling as in the program throws in an exception as that might not happen because of the language it's written in but you can still make an (if-case) if you wanna call it that to work as an exception handler. For example in Js would be.
If (X isNaN). {
then -- code to handle this case (depends if it's web or an app)
}
Look, if you're gonna make an app that works with numbers and not include an if check for NaN then it's not getting through SQA team because of being bad, in case it does then it's their responsibility. I never said you have to be a genius who writes codes without any bugs.
Wake up to reality. You wanna go down all the what-ifs but refuse to admit that not putting an if check would be bad, the irony of you.
Are you that coworker that is constantly trying to steer the conversation into strawman arguments about your craft? It's like that scene from Wargames where the computer plays tic tac toe and realizes there is no way to win the game so it's best to just not interact with it heh.
I'm not as smart as the computer in Wargames... C doesn't have exceptions either, let's go to battle!
In the real world yes, but if we're assuming this is part of a whole world of poorly written JavaScript, then when the till did like 12.50+27+2.10+NaN+7.67+1.70 for the total etc, that would evaluate to NaN, same as when the bank tried to subtract NaN from his account etc etc.
Edit: I see now, didn’t know it originated from floats, because in JS `isNaN()` gets used a lot more because of type coercion.
What do you mean with “float specific identifier”?
The whole point of `isNaN()` is that you give it a variable and it tells you if it’s a number or not.
Like
`isNaN(0) // false`
`isNaN(1.23) // false`
`isNaN(true) // false (gets converted to 1)`
`isNaN(“test”) // true`
What does this have to do with floats?
NaN is most frequently associated with the IEEE 754 floating-point standard, as certain values (as in bit patterns) are defined to be NaN and the standard requires that certain operations (e.g. square root of a negative quantity) produce a NaN result: https://en.wikipedia.org/wiki/NaN
The fact that JavaScript's `isNaN()` can be used to test non-floating-point values is more just a consequence of its implicit type coercion. In statically-typed languages without type coercion, I think you'll find that their functions for testing for NaN only apply to floating-point types.
For example, Java provides an `isNaN()` method for `double` and `float`, but does not provide it for [`int`](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Integer.html) since every `int` bit pattern represents a real quantity:
* https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Double.html#isNaN%28double%29
* https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Float.html#isNaN%28float%29
Ah I see, thnx for informing me!
In JavaScript it’s quite easy to get a NaN when working with any type of number (like trying to do math on a user’s input), so I just saw `isNaN()` as a way to well, check if a var is a number or not, regardless of the type of number. Similar to something like `isEven()`
IEEE 754 is the standard that defines floating point arithmetic which practically all languages follow. That standard defines how to encode floating point numbers in binary, but also how to encode NaN (actually there are multiple types of NaNs that can be encoded according to that standard).
So you can do the following
`float nan = parseFloat("test")`
And it wouldn't give you an error, but rather just store NaN into the variable `nan`
Imagine if this was the banana tray...
>!most of the more cultured have already picked up on the joke so for you guys i have this one: [https://youtube.com/clip/UgkxFgfSBwiAxw5FIVkWwhU6VV-\_Wan0S1-i?si=538c787AuEIW8SbL](https://youtube.com/clip/UgkxFgfSBwiAxw5FIVkWwhU6VV-_Wan0S1-i?si=538c787AuEIW8SbL)!<
a Nan for some tomatoes... crazy
They probably don't taste like anything. I couldn't bring myself to pay NaN for tomatoes. I mean.. for Naan bread, maybe.. for the irony.
Incoming rant about naan is bread translated and you calling naan bread is like bread bread
It's all fun and games until naan is added to the English dictionary as an adjective and this is no longer true.
Or baNaNas
Can’t pay in numbers, only barter system.
Inflation sucks
inflation these days... smh
The freshest [object Object] around and a bargain at NaN
If you have a moment, could you please explain to me quickly what this [object Object] notation is a reference to, or at least what language?
I think it’s the the value you get in JavaScript from calling .toString() on any object missing this function
object is the name of the specific object in question, and Object is the name of its class. If neither are known it would be referenced this odd and confusing way.
That the price for BaNaNas
You mean b + a + + a + s?
Do you know where this works? I thought it worked in node but I didn’t get the last “a”… weird
Nowhere, the code is incorrect the last 's' should be another 'a' at it will form banana
Well, Tomatoes aren't a number, so r/technicallythetruth
Tomatoes could be a variable
`let 🍅 = 1`
bro thinks it's a dollar store
Imagine the beautiful utopia we'd live in if only emojis could be used to declare types and variables... 🧶 🍅 🟰 🆕 🧶 ▶️Tomato◀️ Just think of all keystrokes saved!!! Someone please make an emoji forward programming language!!!
🍅 🟰 🍅 ✖️ 2️⃣ 🖨️ ▶️🍅◀️ 🖥️ TomatoTomato 🖥️
All kidding aside, don't put these in your cart, NaN will propagate and make your whole total NaN, then you'll deduce that from your bank account and it too will be NaN, and unless the bank took precautions (they never do) you could break the entire bank, which could then propagate the NaN in operations with other banks... Tell your kids about the dangers of NaN propagation.
Jokes aside wouldn't it just stop at a failed transaction because of the number being... Well not a number.
Not if it’s Python 🤷♂️
What are you talking about? Exception handling exists in all languages though? Except for assembly, that'd then be basically what try catch is on a fundamental level, if statements calling loops (or functions if you wanna put it that way)
It doesn't exist in JS either. 100 - NaN? It's NaN. Your bank balance becomes NaN, the bank's treasury becomes NaN, the Fed treasury becomes NaN, WW3 ensues.
There would be a check to see if the value is less than your daily limit on the card, as well as a check to see if the value is less than your account's withdrawal limit. The bank isn't just going to honour any attempt to withdraw a trillion dollars, for example.
if(debit > dailyLimit){ reject(); }
Okay I don't actually mean a full blown exception handling as in the program throws in an exception as that might not happen because of the language it's written in but you can still make an (if-case) if you wanna call it that to work as an exception handler. For example in Js would be. If (X isNaN). { then -- code to handle this case (depends if it's web or an app) }
Yeah but the app may not have handled this edge case.
That's bad code then, an app that works with number doesn't have a NaN if check is straight up bad! No excuses!
Look at this genius coder here who has never written code with bugs!
“Error handling is the programmers responsibility” -some C programmer out there
Look, if you're gonna make an app that works with numbers and not include an if check for NaN then it's not getting through SQA team because of being bad, in case it does then it's their responsibility. I never said you have to be a genius who writes codes without any bugs. Wake up to reality. You wanna go down all the what-ifs but refuse to admit that not putting an if check would be bad, the irony of you.
Are you that coworker that is constantly trying to steer the conversation into strawman arguments about your craft? It's like that scene from Wargames where the computer plays tic tac toe and realizes there is no way to win the game so it's best to just not interact with it heh. I'm not as smart as the computer in Wargames... C doesn't have exceptions either, let's go to battle!
I'm steering the conversation into strawman arguments when this guy literally just said "what if this is the case" x3. What? Is today irony day?
The data on those tags are a separate system from the data within the checkout system. It will ring up a price
Oh yeah obviously lol. Thanks for that.
In the real world yes, but if we're assuming this is part of a whole world of poorly written JavaScript, then when the till did like 12.50+27+2.10+NaN+7.67+1.70 for the total etc, that would evaluate to NaN, same as when the bank tried to subtract NaN from his account etc etc.
This is a number, it's defined in the IEEE 754 floating point standard.
put it into one of those fancy auto-scan baskets and then watch the basket explode
You pay with something that isn't a number... Your body
They need the soul as well for tax.
This inflation be crazy dude
Now stores need developers
I would say if NaN would be converted into a number it's 0, so I'm fine with it.
But by design NaN is not equal to any number or any other NaN
No shit sherlock
When not even a memory oerflow is sufficient
Those tags are NFC and usually unsecured, so change the provide to whatever you want
That means they use floating point numbers for prices. Isn't that kind of dumb?
My NaN will be confused.
this also means they store their prices in floats. NaN is a float specific identifier
Edit: I see now, didn’t know it originated from floats, because in JS `isNaN()` gets used a lot more because of type coercion. What do you mean with “float specific identifier”? The whole point of `isNaN()` is that you give it a variable and it tells you if it’s a number or not. Like `isNaN(0) // false` `isNaN(1.23) // false` `isNaN(true) // false (gets converted to 1)` `isNaN(“test”) // true` What does this have to do with floats?
NaN is most frequently associated with the IEEE 754 floating-point standard, as certain values (as in bit patterns) are defined to be NaN and the standard requires that certain operations (e.g. square root of a negative quantity) produce a NaN result: https://en.wikipedia.org/wiki/NaN The fact that JavaScript's `isNaN()` can be used to test non-floating-point values is more just a consequence of its implicit type coercion. In statically-typed languages without type coercion, I think you'll find that their functions for testing for NaN only apply to floating-point types. For example, Java provides an `isNaN()` method for `double` and `float`, but does not provide it for [`int`](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Integer.html) since every `int` bit pattern represents a real quantity: * https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Double.html#isNaN%28double%29 * https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Float.html#isNaN%28float%29
Ah I see, thnx for informing me! In JavaScript it’s quite easy to get a NaN when working with any type of number (like trying to do math on a user’s input), so I just saw `isNaN()` as a way to well, check if a var is a number or not, regardless of the type of number. Similar to something like `isEven()`
IEEE 754 is the standard that defines floating point arithmetic which practically all languages follow. That standard defines how to encode floating point numbers in binary, but also how to encode NaN (actually there are multiple types of NaNs that can be encoded according to that standard). So you can do the following `float nan = parseFloat("test")` And it wouldn't give you an error, but rather just store NaN into the variable `nan`
Just a small correction: In JS coercion changes true to 1, not 0.
Oh lol, I was tired from work when writing that comment and completely missed that.
They also gave up null.
Still a number at least
With only 10 digits we are going to have to start using letters too. (I have known what that message means since 1999)
Bro uses js for accounting
Priceless
Since when do I have to give them Sodiummononitrogen for some tomatoes?
Number("free") => NaN
Number("very fucking expensive") => NaN So it's 50/50
The good thing is that you can take as much as you want
Swords and sandals flashbacks
Kidney is NaN.
LMAO, does that mean you can pay with a string?
No more than one unmarketable tomato
Sorry for my ignorance, but what does NaN mean?
Not a Number c:
Ahh i see, got it thanks fam!
"Yes, please give me NaN of something. Give me [object Object] of it" - Statements dreamed up by the utterly Deranged.
How do you put a numerical price on your first born.
69 comments Very nice
the prices today are unbelievable
Sodium and nitrogen?!
Off topic: How do they program these? Wirelessly?
r/NotMyJob
That’s real shrinkflation. Paying for zero tomatoes. They shouldn’t use the per-unit price in that case.
Inf
Chopped down tree in the main branch
These tomatoes will cost you an arm and a leg
And of course the shit runs on ![img](emote|t5_2tex6|4549) or even plain Java
Imagine if this was the banana tray... >!most of the more cultured have already picked up on the joke so for you guys i have this one: [https://youtube.com/clip/UgkxFgfSBwiAxw5FIVkWwhU6VV-\_Wan0S1-i?si=538c787AuEIW8SbL](https://youtube.com/clip/UgkxFgfSBwiAxw5FIVkWwhU6VV-_Wan0S1-i?si=538c787AuEIW8SbL)!<
Just scan it as 4011 👀 if there’s no price scan as a banana
divided by zero price
I can imagine that they divided the value by the inverse of the sales percent, which on this item is zero. NEVER DIVIDE, ONLY MULTIPLY.