anchor.diff:      (prefix-symbol (prefix-of instance))))
   
   
  +(eval-when (:compile-toplevel :load-toplevel :execute)
  +  (defconstant *si-degrees*
  +    (cond
  +      ((boundp '*si-degrees*)
  +       (values *si-degrees*))
  +      (t 
  +       (make-array 21
  +                   :element-type '(integer -24 24)
  +                   :initial-contents
  +                   '(24 21 18 15 12 9 6 3 2 1 
  +                     0
  +                     -1 -2 -3 -6 -9 -12 -15 -18 -21 -24))
  +      ))))
  +
  +
   (deftype prefix-degree ()
     '(and (integer -24 24)
       ;; formally onto the SI standard for decimal prefixes
  -    (member 0 
  -     1 2 3 6 9 12 15 18 21 24
  -     -1 -2 -3 -6 -9 -12 -15 -18 -21 -24)))
  +    #.(cons 'member (coerce *si-degrees* 'list))))
   
   ;; (typep -5 'prefix-degree)
   ;; => NIL
   ;; (typep 9 'prefix-degree)
   ;; => T
  +
  +
  +(defun find-nearest-degree (deg &optional ee-p)
  +  (declare (type fixnum deg)
  +           (values prefix-degree))
  +  (cond
  +    ((zerop deg) (values 0))
  +    ((> deg 24) (values 24))
  +    ((< deg -24) (values -24))
  +    (t 
  +     (let ((n (unless ee-p
  +                (find deg *si-degrees* :test #'=))))
  +       (cond
  +         (n (values n))
  +         (t 
  +          (labels ((test (a b)
  +                     (declare (type fixnum a)
  +                              (type (integer -24 24)
  +                                    b))
  +                     (cond
  +                       (ee-p 
  +                        (and (= (gcd b 3) 3)
  +                             (> a b)))
  +                       (t (> a b)))))
  +            (let ((n (position deg *si-degrees*
  +                               :test #'test)))
  +              (aref *si-degrees* n)))))))))
  +
  +;; (find-nearest-degree 0)
  +;; => 0
  +
  +;; (find-nearest-degree 25)
  +;; => 24
  +
  +;; (find-nearest-degree -25)
  +;; => -24
  +
  +;; (find-nearest-degree 5)
  +;; => 3
  +
  +;; (find-nearest-degree -5)
  +;; => -6
  +
  +;; (find-nearest-degree -2)
  +;; => -2
  +;; (find-nearest-degree -2 t)
  +;; => -3
  +
  +
  +;; (find-nearest-degree 1)
  +;; => 1
  +;; (find-nearest-degree 1 t)
  +;; => 0
  +
  +
  +(defun scale-for-si-degree (magnitude scale &optional ee-p)
  +  (declare (type real magnitude)
  +           (type fixnum scale)
  +           (values real prefix-degree))
  +  (cond
  +    ((zerop scale) 
  +     (values magnitude sale))
  +    (t 
  +     (let ((deg (find-nearest-degree scale ee-p)))
  +       (values (* magnitude (expt 10 (- scale deg)))
  +               deg)
  +       ))))
  +
  +;; (scale-for-si-degree 1 5)
  +;; => 100, 3
  +;; (= 1E+05 100E+03)
  +
  +;; (scale-for-si-degree 1 -5)
  +;; => 10, -6
  +;;
  +;; (= 1E-05 10E-06)
  +;; => T
  +
  +;; (scale-for-si-degree 1 -2)
  +;; => 1, -2
  +
  +;; (scale-for-si-degree 1 -2 t)
  +;; => 10, -3
  +
  +
  +;; (scale-for-si-degree 1 2)
  +;; => 1, 2
  +
  +;; (scale-for-si-degree 1 2 t)
  +;; => 10, 1
  +;;
  +;; (= (* 1 (expt 10 2)) (* 10 (expt 10 1)))
  +;; => T
  +
  +
   
   (defclass* prefix ()
     ;; NOTE: This class is applied effectively as a DECIMAL-PREFIX 
  
positive.code: ;; (measurement-degree (make-measurement-1 1 :m 3))
  ;; => 3
  
  ;; (make-measurement-1 1000 :m 3)
  ;; => #<METER 1E+3 km {1003FF93A3}>
  ;
  ;; (measurement-magnitude (make-measurement 1000 :m 3))
  ;; => 1000
  
negative.code:            (values prefix))
    (or (find s %prefixes%
              :test #'eq
              :key #'prefix-symbol)
        (error 'prefix-not-found :name s)))
  
  ;; (find-prefix :|m|)
  
  
  (defun find-prefix= (d)
    (declare (type prefix-degree d)
             (values prefix))
    (or (find d %prefixes%
              :test #'=
              :key #'prefix-degree)
        (error 'prefix-degree-not-found
               :name d)))
  
  ;; (find-prefix= -9)
  ;;  <<nano>>
             
  
  
  
  ;; define prefix classes
  