[Edu-sig] new python // and /
Kevin Driscoll
driscollkevin at gmail.com
Sat May 27 02:07:28 CEST 2006
I introduce the issue of integer versus floating point division by
giving (high school) students a self-directed programming challenge
that will lead them to the head scratching conclusion that division
doesn't work exactly in the manner that they expect. Using long
division on the board, it's pretty easy to demonstrate how integer
division and use of the modulo division complement one another.
As time is also of the essense in my course, we usually settle on the
pragmatic axiom of almost always using a floating-point divisor.
This reminds me of the recent thread regarding equal sign ambiguity.
Perhaps we could start collecting examples of familiar symbols from
mathematics that might confuse a new programmer.
Kevin Driscoll
More information about the Edu-sig
mailing list