[Tutor] Why doesn't this work??

Deirdre Saoirse deirdre@deirdre.net
Mon, 31 Jul 2000 15:48:20 -0700 (PDT)


On Mon, 31 Jul 2000, Carl Kreider wrote:

> I agree that 0, 20, 30, and 40 mod 10 yield 0, but since
> when does 10, 50, or 60 mod 10 yield 10?  Do I misremember
> how mod works?

mod is an integer-based function, so yes, you misremembered.

You'll get quite different results if you change two lines as follows:

        num = (int) (T / dt)
        den = (int) (interval / dt)

-- 
_Deirdre   *   http://www.sfknit.org   *   http://www.deirdre.net
"We can always count on the British. Except for the Revolutionary War
they've been perfect." -- Mel Brooks, on the first Concorde flight since 
the Paris crash.