close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

Changeset 3384 for branches


Ignore:
Timestamp:
2015-08-27T08:41:06-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/ring.lisp

    r3383 r3384  
    127127  (:method ((x integer) (y integer)) (expt x y))
    128128  (:method (x  (y integer))
    129                       &aux
    130   (declare (type fixnum n))
    131   (cond
    132     ((minusp n) (error "r-expt: Negative exponent."))
    133     ((endp poly) (if (zerop n) 1))
    134     (t
    135      (do ((k 1 (ash k 1))
    136           (q poly (r* q q)) ;keep squaring
    137           (p 1 (if (not (zerop (logand k n))) (r* (r* p q) p))))
    138          ((> k n) p)
    139        (declare (fixnum k))))))
     129    (declare (type fixnum n))
     130    (cond
     131      ((minusp n) (error "r-expt: Negative exponent."))
     132      ((endp poly) (if (zerop n) 1))
     133      (t
     134       (do ((k 1 (ash k 1))
     135            (q poly (r* q q))           ;keep squaring
     136            (p 1 (if (not (zerop (logand k n))) (r* (r* p q) p))))
     137           ((> k n) p)
     138         (declare (fixnum k))))))
    140139  (:documentation "Raises X to power Y."))
    141140
Note: See TracChangeset for help on using the changeset viewer.