Open jpelay opened 1 month ago
A quick Google search led me to an answer on StackOverflow which pointed to the Decimal type.
A quick Google search led me to an answer on StackOverflow which pointed to the Decimal type.
It's not implemented in Skulpt 😢 so we can't use that :/
I had a similar (?) problem in level 6. I would expect 360/19 to be 19 not 18. I agree with 'against keeping this behavior'.
A teacher reported this to us in an email:
I checked and the reason is IEE754, because this is the result that Pythons gives:
So, two lines of argumentation can be given with respect to how we can deal with things like these:
In pro of keeping this behavior: since Hedy is teaching programming to kids, and the end goal is to end up programming in Python, this behavior should be kept. Ultimately, this is how floating point numbers are going to work in pretty much every programming language. Changing the above comparison to work, would cause confusion if they eventually move to Python and then figuring out that floating point numbers are funky.
Against: We should change it because we are trying to simplify programming, and teaching it step-by-step, and part of that requires simplifying how floating point numbers work, so it's up to students to later on adapt to the realities of IEE754. There must be a library that has floating point numbers that work like the ones we are used to, specially for accounting, where such things are essential.