Update of /cvsroot/win32forth/win32forth-stc/src
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30780/win32forth-stc/src
Modified Files:
Utils.f
Log Message:
gah:Modified random to use fm/mod since it relies on floored division
Index: Utils.f
===================================================================
RCS file: /cvsroot/win32forth/win32forth-stc/src/Utils.f,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Utils.f 3 May 2007 09:00:02 -0000 1.2
--- Utils.f 9 May 2007 07:28:44 -0000 1.3
***************
*** 662,669 ****
\ *G Get a pseudo random number between 0 and n1 as n2. n2 has the same sign as n1.
dup 0= if 1+ then
! SEED1 177 /MOD 2* SWAP 171 * SWAP - DUP to SEED1
! SEED2 176 /MOD 35 * SWAP 172 * SWAP - DUP to SEED2
! SEED3 178 /MOD 63 * SWAP 170 * SWAP - DUP to SEED3
! + + SWAP MOD ;
: RANDOM-INIT ( -- ) \ W32F Utils
--- 662,669 ----
\ *G Get a pseudo random number between 0 and n1 as n2. n2 has the same sign as n1.
dup 0= if 1+ then
! SEED1 s>d 177 fm/MOD 2* SWAP 171 * SWAP - DUP to SEED1
! SEED2 s>d 176 fm/MOD 35 * SWAP 172 * SWAP - DUP to SEED2
! SEED3 s>d 178 fm/MOD 63 * SWAP 170 * SWAP - DUP to SEED3
! + + s>d rot fm/MOD drop ;
: RANDOM-INIT ( -- ) \ W32F Utils
|