From 85751cda2bb510f4cd8da4d0cea519e404e25363 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 24 Jul 2019 13:19:38 -0400 Subject: [PATCH] Issue #326 - Use timer to seed pseudorandom numbers --- CHANGELOG.md | 1 + srfi/27.sld | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed1cdde3..f7b088af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Bug Fixes - Fixed the MSYS2 build script and instructions, so it is possible to build on Windows again! - Fixed `exit` to return the appropriate status code when a boolean is passed, per R7RS: +- Modified `(srfi 27)` to use the timer to seed the pseudorandom number generator. > If no argument is supplied, or if obj is #t, the exit procedure should communicate to the operating system that the program exited normally. If obj is #f, the exit procedure should communicate to the operating system that the program exited abnormally. diff --git a/srfi/27.sld b/srfi/27.sld index ed67b447..a3a9d140 100644 --- a/srfi/27.sld +++ b/srfi/27.sld @@ -22,7 +22,7 @@ (begin ;; Numbers taken from bsd random ;(define mult 1103515245) - (define incr 12345) + (define incr (exact (current-second))) (define m 536870912) ;; Cutting off seems like a good idea ;(define cutoff 100)