Its basically giving you a heads up to keep an eye out for floating numbers. Yes you can add them together similar to integer numbers, but you might not always get the answer you are expecting.
adding 0.1 and 0.2 we would expect the result to be 0.3, but because floating numbers we end up with 0.30000000000000004. You don’t have to worry about it to much right now, but later on you will need to deal with this.
It depends how much accuracy you want. But since computers are base 2, no fraction that is not an exponent of 2 can be represented with perfect precision with finite digits. Similarly in base 10, only fractions that are a combination of exponents of 2 and 5 can be accurately represented: 1/2 = 0.5, 1/5 = 0.2, 1/10 = 0.1, 1/4 = 0.25, etc. Anything else is impossible to represent with a finite number of digits, e.g., 1/3, 1/5, 1/11, 1/6, etc.
I realize I don’t need to worry about the difference now, but if someone is of the belief they are the same and are working on probes and satellites going to other planets in our solar system, it is good to set an example that: for our teaching model it doesn’t matter, but for high level science it really does.
I once had medication that said it was the exact same medication I was taking. I assumed with the language that was used it was identical… it was not. It was the same type of medication but the dosage was very different.
Many people are able to see the meaning behind what is said, instead of what is actually said. Some people are very literal in their communication and have difficulty when others are not as literal. I just wanted to point out that the way it is presented in this video could trip some people up.
But anyone that is doing that level of math is going to know the limitations of floating point arithmetic and how to work around it in various languages and libraries. It would be prohibitive in an entry level course to go into that level of detail on a subject that is just going to bore people, isn’t going to matter 99.99% of the time for most of us, and most people would quickly forget at this point anyway. I think it is enough to say that floating point arithmetic has some limitations. If people are curious, they can look it up.
I agree going in depth is not worth it in a beginning class, But I don’t agree in saying they are the same. It would be like saying PI is the same as 3.14. It is similar enough for basic learning to call it good, not worth going into the exactness of it.
I agree the syntax is the same, but if I believe the results will always be the same I might fall into trouble later. There are quite a few things that have the same syntax or procedures, but quite different results.
The video says that the syntax is the same. The written challenge information says that the syntax is the same. That’s what ‘the same as’ means in this context. Nobody said or meant that floating point multiplication is perfectly accurate in the video or the written challenge description, that I could find.
I think yu are reading too much into saying that they are “the same”. It’s about context an expected level of exactness. I was talking to a friend here in Spain and mentioned the American grocery store Safeway. He didn’t know what it was so I said it was the same thing as Carre Four. Now, of course, they aren’t exactly the same thing, but for the purposes of that convrsation, it was good enough.
Smilarly, for explaining how JS mathematical operators work, saying integer and flouting point math are he same is good enough.
Every programming learner will eventually run into floating point errors and will learn from the experience. And I think that that will stick in their head better.
No professional programmer is going to not understand this. The only way that could happen is if they get hired after only learning the very basics of coding, And in that case, the employer deserves what they get. NASA is not hiring coders with two months of self-taught coding.
And given that there is very non-specific or implicit language in English that we use specific or explicit words to mean things in coding, like = is assign, == is equal to or compare, saying equivalent is a much more accurate term without going into a long explanation that would bore most newcomers.
“Multiplying decimal point numbers or floating point numbers is the same as multiplying intergers” Those the the first words of the video.
But I get that not everyone is going to see it the same way as I do, and that is ok. I’m just looking out for those who tend towards a more literal interpretation of words instead of massaging it to what the person ment to say.
If you feel strongly about this, you can request that the video is deleted from the curriculum. This would be via a GitHub Issue.
Otherwise, this conversation is flogging a dead horse at this point. We all understand what the video means. We understand that you believe some learners might draw some wrong interpretations from the video. We disagree. The only fix available is deleting the video.