Changeset 13819 in project for chicken


Ignore:
Timestamp:
03/18/09 15:13:35 (11 years ago)
Author:
Kon Lovett
Message:

Applied Will Farr's rand patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/chicken.h

    r13328 r13819  
    10381038#define C_words(n)                      C_fix(C_bytestowords(C_unfix(n)))
    10391039#define C_bytes(n)                      C_fix(C_wordstobytes(C_unfix(n)))
    1040 #define C_random_fixnum(n)              C_fix(rand() % C_unfix(n))
     1040#define C_random_fixnum(n)              C_fix((int)(((double)rand())/(RAND_MAX + 1.0) * C_unfix(n)))
    10411041#define C_randomize(n)                  (srand(C_unfix(n)), C_SCHEME_UNDEFINED)
    10421042#define C_block_size(x)                 C_fix(C_header_size(x))
Note: See TracChangeset for help on using the changeset viewer.