1.0.4.6:
[sbcl.git] / src / code / random.lisp
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
9
10 (in-package "SB!KERNEL")
11
12 ;;; the size of the chunks returned from the fundamental random number
13 ;;; generator
14 (def!constant n-random-chunk-bits 32)
15 (def!constant most-positive-random-chunk
16   (1- (ash 1 n-random-chunk-bits)))
17
18 ;;; our implementation of the RANDOM-STATE type specified by ANSI CL
19 (sb!xc:defstruct (random-state (:constructor %make-random-state)
20                                ;; Shallow copy would be wrong: we must
21                                ;; effectively COPY-SEQ the STATE slot.
22                                (:copier nil))
23   (state (init-random-state) :type (simple-array (unsigned-byte 32) (627))))