Changeset 3568
- Timestamp:
- 09/04/03 00:18:18 (20 years ago)
- Location:
- trunk/j/src/org/armedbear/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/autoloads.lisp
r3557 r3568 2 2 ;;; 3 3 ;;; Copyright (C) 2003 Peter Graves 4 ;;; $Id: autoloads.lisp,v 1.1 4 2003-09-02 17:50:32piso Exp $4 ;;; $Id: autoloads.lisp,v 1.15 2003-09-04 00:18:18 piso Exp $ 5 5 ;;; 6 6 ;;; This program is free software; you can redistribute it and/or … … 74 74 (autoload 'make-pathname) 75 75 (autoload '(floor ceiling round rem mod ftruncate ffloor fceiling fround 76 rational rationalize isqrt)76 rational rationalize gcd isqrt) 77 77 "numbers.lisp") -
trunk/j/src/org/armedbear/lisp/numbers.lisp
r3557 r3568 2 2 ;;; 3 3 ;;; Copyright (C) 2003 Peter Graves 4 ;;; $Id: numbers.lisp,v 1. 9 2003-09-02 17:49:54piso Exp $4 ;;; $Id: numbers.lisp,v 1.10 2003-09-04 00:17:46 piso Exp $ 5 5 ;;; 6 6 ;;; This program is free software; you can redistribute it and/or … … 164 164 rationalize))) 165 165 166 167 168 (defun gcd (&rest numbers) 169 "Returns the greatest common divisor of the arguments, which must be 170 integers. Gcd with no arguments is defined to be 0." 171 (unless (every #'integerp numbers) 172 (error 'type-error)) 173 (cond ((null numbers) 0) 174 ((null (cdr numbers)) (abs (car numbers))) 175 (t 176 (do ((gcd (car numbers) 177 (gcd-2 gcd (car rest))) 178 (rest (cdr numbers) (cdr rest))) 179 ((null rest) gcd))))) 166 180 167 181
Note: See TracChangeset
for help on using the changeset viewer.