Unexpected behaviour of math.floor, round and int functions (rounding)

Grant Edwards grant.b.edwards at gmail.com
Sat Nov 20 17:21:21 EST 2021


On 2021-11-20, Chris Angelico <rosuav at gmail.com> wrote:

> But you learn that it isn't the same as 1/3. That's my point. You
> already understand that it is *impossible* to write out 1/3 in
> decimal. Is it such a stretch to discover that you cannot write 3/10
> in binary?

For many people, it seems to be.

There are plenty of people trying to write code who don't even under
the concept of different bases.

I remember trying to explain the concept of CPU registers, stacks,
interrupts, and binary representations to VAX/VMS FORTRAN programmers
and getting absolutely nowhere.

Years later, I went through the same exercise with a bunch of Windows
C++ programmers, and they seemed similarly baffled.

Perhaps I was just a bad teacher.
 
--
Grant



More information about the Python-list mailing list