home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / RLaB 1.18c / toolbox / rem.r < prev    next >
Encoding:
Text File  |  1994-05-21  |  481 b   |  19 lines  |  [TEXT/ttxt]

  1. //-------------------------------------------------------------------//
  2. //
  3. //  Syntax:     rem ( A, B )
  4.  
  5. //  Description:
  6.  
  7. //  Calculate remainders.
  8. //  `mod ( A, B )' is equivilant to `rem ( A, B)'. Mod is a builtin
  9. //  function, and is much faster when operating on matrices. Rem is
  10. //  provided mostly for MATLAB compatibility.
  11.  
  12. //-------------------------------------------------------------------//
  13.  
  14. rem = function(x,y) 
  15. {
  16.   # return (x-y.*int(x./y));
  17.   return mod (x, y);
  18. };
  19.