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 am referring to the video, where it says that working with floats is the same as working with numbers. My point is that they are similar, not the same.
The syntax is the same. The one of the big points behind using high level languages is that you donât have separate i32Multiply(a, b) and f64Multiply(a, b).
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.
It just really stood out to me as the video before it made sure to provide a link as to why it wasnât exact. And if someone doesnât watch all the videos, they may miss that portion.
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.
Well, when the previous video makes mention of the errors, and they say % is not Modulus but remainder, it leads me to believe that they are going for accuracy.
As far as reading too much into it, I donât think I am the only person who would have questions about that, but I was willing to risk looking like a fool for pointing it out.
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.