numsup.red 647 B

1234567891011121314151617181920212223242526272829
  1. module numsup; % Numerical support for basic algebra package.
  2. % Author: Anthony C. Hearn.
  3. % Copyright (c) 1991 The RAND Corporation. All rights reserved.
  4. % Numerical greatest common divisor.
  5. symbolic procedure gcdn(u,v);
  6. % U and v are integers. Value is absolute value of gcd of u and v.
  7. if v = 0 then abs u else gcdn(v,remainder(u,v));
  8. % Interface to rounded code.
  9. % Only needed if package ARITH is autoloaded.
  10. % switch rounded;
  11. % put('rounded,'package!-name,'arith);
  12. % put('rounded,'simpfg,
  13. % '((t (load!-package 'arith) (setdmode 'rounded t))));
  14. % Enough for now.
  15. endmodule;
  16. end;