Changeset f67df3 in git


Ignore:
Timestamp:
Apr 21, 2006, 6:59:47 PM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
ff89aa844cb04cbe6032cb5a00457f30b8b286ab
Parents:
6b503cf35c050c03092ac141a3f9b454cd8c8bc9
Message:
*hannes: 64bit fixes


git-svn-id: file:///usr/local/Singular/svn/trunk@9068 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_random.cc

    r6b503c rf67df3  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_random.cc,v 1.7 2005-08-22 17:24:01 Singular Exp $ */
     2/* $Id: cf_random.cc,v 1.8 2006-04-21 16:59:47 Singular Exp $ */
    33
    44#include <config.h>
     
    1616class RandomGenerator {
    1717private:
    18     const long int ia, im, iq, ir, deflt;
    19     long s;
     18    const int ia, im, iq, ir, deflt;
     19    int s;
    2020
    2121    // s must not equal zero!
    22     void seedInit( long ss ) { s = ((ss == 0) ? deflt : ss); }
     22    void seedInit( int ss ) { s = ((ss == 0) ? deflt : ss); }
    2323public:
    2424    RandomGenerator();
    25     RandomGenerator( long ss );
     25    RandomGenerator( int ss );
    2626    ~RandomGenerator() {}
    27     long generate();
    28     void seed( long ss ) { seedInit( ss ); }
     27    int generate();
     28    void seed( int ss ) { seedInit( ss ); }
    2929};
    3030
    3131RandomGenerator::RandomGenerator() : ia(16807), im(2147483647), iq(127773), ir(2836), deflt(123459876)
    3232{
    33   seedInit( (long)time( 0 ) );
     33  seedInit( (int)time( 0 ) );
    3434}
    3535
    36 RandomGenerator::RandomGenerator( long ss ) : ia(16807), im(2147483647), iq(127773), ir(2836), deflt(123459876)
     36RandomGenerator::RandomGenerator( int ss ) : ia(16807), im(2147483647), iq(127773), ir(2836), deflt(123459876)
    3737{
    3838  seedInit( ss );
    3939}
    4040
    41 long
     41int
    4242RandomGenerator::generate()
    4343{
    44     long k;
     44    int k;
    4545
    4646    k = s/iq;
Note: See TracChangeset for help on using the changeset viewer.