Changeset 39993 in project


Ignore:
Timestamp:
04/13/21 18:43:07 (4 months ago)
Author:
Kon Lovett
Message:

fix use of modulo w/ inexact

Location:
release/5/srfi-27/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/srfi-27/trunk/moa.scm

    r39954 r39993  
    204204;;
    205205
     206(define (entropy-source-big-integer entropy-source)
     207  ;64 bit entropy used as a bit source, not a number source!
     208  (modulo (inexact->exact (entropy-source-f64-integer entropy-source)) eMAX) )
     209
    206210(define (make-state) (make-u32vector STATE-LENGTH))
    207211
     
    235239
    236240(define (moa-randomize-state state entropy-source)
    237   (init_state
    238     state
    239     (inexact->exact
    240       (modulo
    241         (fpabs (entropy-source-f64-integer entropy-source))
    242         fpMAX)))
     241  (init_state state (entropy-source-big-integer entropy-source))
    243242  state )
    244243
  • release/5/srfi-27/trunk/mwc.scm

    r39954 r39993  
    200200;;
    201201
     202(define (entropy-source-big-integer entropy-source)
     203  ;64 bit entropy used as a bit source, not a number source!
     204  (modulo (inexact->exact (entropy-source-f64-integer entropy-source)) eMAX) )
     205
    202206(define (make-state) (make-u32vector STATE-LENGTH))
    203207
     
    230234    (fx= STATE-EXTERNAL-LENGTH (length obj)) ) )
    231235
    232 ;; 64 bit entropy used as a bit source, not a number source!
    233236(define (mwc-randomize-state state entropy-source)
    234   (init_state
    235     state
    236     (inexact->exact
    237       (modulo
    238         (fpabs (entropy-source-f64-integer entropy-source))
    239         fpMAX)))
     237  (init_state state (entropy-source-big-integer entropy-source))
    240238  state )
    241239
  • release/5/srfi-27/trunk/srfi-27.egg

    r39954 r39993  
    22
    33((synopsis "Sources of Random Bits")
    4  (version "4.1.2")
     4 (version "4.1.3")
    55 (category data)
    66 (author "Sebastian Egner, for CHICKEN by Kon Lovett and [[Sergey Goldgaber]]")
Note: See TracChangeset for help on using the changeset viewer.