From fcd65db754f3a5062fccf136bc633e658e4967b3 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Tue, 30 Sep 2008 07:56:57 +0000 Subject: [PATCH] 1.0.20.33: two buglets, LOG and TIME * Unbreak (LOG DOUBLE INTEGER). * LAMBDAS-CONVERTED / LAMBDA-CONVERSIONS confusion in PRINT-TIME. (patch by Erik Marsden) --- src/code/irrat.lisp | 5 +++-- src/code/time.lisp | 4 ++-- tests/float.pure.lisp | 4 +++- tests/time.pure.lisp | 3 +++ version.lisp-expr | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp index 79be34a..c4e9ad4 100644 --- a/src/code/irrat.lisp +++ b/src/code/irrat.lisp @@ -342,10 +342,11 @@ ((and (typep number '(integer (0) *)) (typep base '(integer (0) *))) (coerce (/ (log2 number) (log2 base)) 'single-float)) - ((or (and (typep number 'integer) (typep base 'double-float)) - (and (typep number 'double-float) (typep base 'integer))) + ((and (typep number 'integer) (typep base 'double-float)) ;; No single float intermediate result (/ (log2 number) (log base 2.0d0))) + ((and (typep number 'double-float) (typep base 'integer)) + (/ (log number 2.0d0) (log2 base))) (t (/ (log number) (log base)))) (number-dispatch ((number number)) diff --git a/src/code/time.lisp b/src/code/time.lisp index b572f36..a6dbc94 100644 --- a/src/code/time.lisp +++ b/src/code/time.lisp @@ -265,7 +265,7 @@ format." (defun print-time (&key real-time-ms user-run-time-us system-run-time-us gc-run-time-ms processor-cycles eval-calls - lambda-conversions page-faults bytes-consed + lambdas-converted page-faults bytes-consed aborted) (let ((total-run-time-us (+ user-run-time-us system-run-time-us))) (format *trace-output* @@ -294,7 +294,7 @@ format." 100.0 (float (* 100 (/ (round total-run-time-us 1000) real-time-ms)))) eval-calls - lambda-conversions + lambdas-converted processor-cycles page-faults bytes-consed diff --git a/tests/float.pure.lisp b/tests/float.pure.lisp index 5140bbd..1b983b7 100644 --- a/tests/float.pure.lisp +++ b/tests/float.pure.lisp @@ -208,7 +208,9 @@ (assert (eql 2567.6046442221327d0 (log (loop for n from 1 to 1000 for f = 1 then (* f n) finally (return f)) - 10d0)))) + 10d0))) + ;; both ways + (assert (eql (log 123123123.0d0 10) (log 123123123 10.0d0)))) (with-test (:name :log-base-zero-return-type) (assert (eql 0.0f0 (log 123 (eval 0)))) diff --git a/tests/time.pure.lisp b/tests/time.pure.lisp index da7f3b9..a9aac4c 100644 --- a/tests/time.pure.lisp +++ b/tests/time.pure.lisp @@ -27,3 +27,6 @@ (when (>= time time1) (return))))))) 3) + +(with-test (:name :time/lambdas-converted) + (time (compile nil '(lambda () 42)))) diff --git a/version.lisp-expr b/version.lisp-expr index 8c762d6..73c728f 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.20.32" +"1.0.20.33" -- 1.7.10.4