[plt-scheme] Error in SRFI 27

From: Doug Williams (m.douglas.williams at gmail.com)
Date: Tue Aug 14 23:08:44 EDT 2007

There seems to have been an error introduced into SRFI 27 sometime late in
the V370 development leading up to V371.  The random reals generated by SRFI
27 all seem to be negative numbers in the range on -1.0e-8 to
-1.0e-10instead of 0 to 1.  The following code shows the problem.  In
V370 it works
properly giving numbers in the range 0.0 to 1.0.  When run under V370.7 or
V371, it gives the bad numbers.

(require (lib "27.ss" "srfi"))

(let* ((r (make-random-source))
       (rand (random-source-make-reals r)))
  (do ((i 0 (+ i 1)))
      ((= i 100) (void))
    (printf "random real = ~a~n"
            (rand))))

Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070814/9dbebdce/attachment.html>

Posted on the users mailing list.