[CM] cmn factorize

Anders Vinjar andersvi@extern.uio.no
Fri, 07 Apr 2006 11:03:10 +0200


In cmn, (rq 1/9) gives a note with 2 flags, where i would think 3
was right.

If this is correct theres something strange with the
factorize-algorithm in cmn2.lisp.  Theres a comment saying the
function is necessary in cases involving nested subdivisions.
The only difference between using (floor (log denominator 2)) is
in the weird cases.

Heres output of cmns #'factorize compared to a straigth logarithm
operation:

(loop for n from 1 to 30 collect 
      (list n
	    (factorize n)
	    (floor (log n 2))))

((1 0 0) (2 1 1) (3 1 1) (4 2 2) (5 2 2) (6 2 2) (7 2 2) (8 3 3) (9 2 3)
 (10 3 3) (11 3 3) (12 3 3) (13 3 3) (14 3 3) (15 3 3) (16 4 4) (17 4 4)
 (18 3 4) (19 4 4) (20 4 4) (21 3 4) (22 4 4) (23 4 4) (24 4 4) (25 4 4)
 (26 4 4) (27 3 4) (28 4 4) (29 4 4) (30 4 4))

Whats right here?