Calculating MOD


[Prev][Next][Index][Thread]

Calculating MOD



As far as I know, none of the TI-xx calcs have support for modular
arithmetic.  For those of you who don't know what that is, you learned it
in 2nd grade.  It is basically a fancy word for the remainder from integer
division (e.g. when doing 6/4, the quotient is 1 and the remainder is 2).
I was doing this in precalc (have no idea why) and I derived the formula
r=n-d*int(n/d) as the formula for r = n MOD d.  I have already used this
formula to speed up quite a few programs and I even devised a method of
making a ?x99 matrix act like a large list using a few changes in the
formula.  I have made a proof of this formula, but I'll only send it to
those who want it.

Remember, n-d*int(n/d)  is equivalent to n MOD d.


                 Thomas J. Hruska -- thruska@tir.com
Shining Light Productions -- "Meeting the needs of fellow programmers"
         http://www.geocities.com/SiliconValley/Heights/8504
                    http://shinelight.home.ml.org

  Spam-Fighter code is:  14806560   (New technique to fighting spam)
  Enter "Spam-Fighter:  XXXXXXXX" in the body of a personal message
  to thruska@tir.com.  Otherwise the message will be filtered as spam.


Follow-Ups: