home *** CD-ROM | disk | FTP | other *** search
/ PC Open 13 / pcopen13.iso / Zip / SM34A.ZIP / LIBRARY / MOD.LI < prev    next >
Encoding:
Text File  |  1995-03-24  |  305 b   |  8 lines

  1. # mod(x,y) gives the remainder on the divison of x by y.
  2. # See also: div.
  3. # e.g. mod(7,2) gives 1, mod(7/3,2) gives 1/3, mod(5.5,2) gives 1.5
  4.  
  5. mod(x_,y_) := if(isratio(x),
  6.  mod(div(nume(x),deno(x)),y)+mod(nume(x),deno(x))/deno(x))
  7. mod(x1_,y1_) := if(not(isinteger(x1)), mod(trunc(x1),y1)+frac(x1))
  8.