Commit 070cdceb authored by Sergey Katrevich's avatar Sergey Katrevich
Browse files

smallfix - increment isn't required in random-mini

parent 542aea4a
......@@ -558,7 +558,7 @@ If a string, repeatedly read and evaluate from it, returning the last values."
(setf v1 (get-internal-real-time))
(sleep (/ 1.0 internal-time-units-per-second 2.0))
(setf v2 (get-internal-real-time))
(1+ (- v2 v1))))
(- v2 v1)))
#|
......@@ -566,21 +566,21 @@ If a string, repeatedly read and evaluate from it, returning the last values."
(defun get-incf-variants-frequency (repeat)
(loop repeat repeat
for n = (random-mini)
if (= 0 n) count t into res-0
if (= 1 n) count t into res-1
if (= 2 n) count t into res-2
if (= 3 n) count t into res-3
finally (return `((1 ,res-1) (2 ,res-2) (3 ,res-3)))))
finally (return `((0 ,res-0) (1 ,res-1) (2 ,res-2)))))
|#
;; Results of checking quality "random-mini" numbers
;(get-incf-variants-frequency 100)
;((1 41) (2 59) (3 0))
;=> ((0 42) (1 56) (2 1))
;(get-incf-variants-frequency 1000)
;((1 426) (2 573) (3 1))
;=> ((0 421) (1 576) (2 2))
;(get-incf-variants-frequency 10000)
;((1 4246) (2 5744) (3 6))
;=> ((0 4289) (1 5703) (2 5))
(defun temp-name-extra-part ()
(format nil "-~36R-~36R" (get-universal-time) (+ (get-internal-real-time) (random-mini))))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment