[system] / trunk / pg / lib / PGrandom.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/PGrandom.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1079 Revision 1454
44 $incr = 1 unless defined($incr); 44 $incr = 1 unless defined($incr);
45 my $seed = $self->{'seed'}; 45 my $seed = $self->{'seed'};
46 my $new_seed = mod ($multiplier * $seed + $translate, $modulus) ; 46 my $new_seed = mod ($multiplier * $seed + $translate, $modulus) ;
47 $self->{'seed'} = $new_seed; 47 $self->{'seed'} = $new_seed;
48 unless ( $incr <= 0 ) { 48 unless ( $incr <= 0 ) {
49 $out = $begin +$incr*int( ($new_seed/($modulus))*( ($end-$begin)/$incr +1 ) ) ; 49 $out = $begin +$incr*int( ($new_seed/($modulus))*(int( ($end-$begin)/$incr) +1) );
50 } else { # if $incr is less than zero return "continuous" distribution 50 } else { # if $incr is less than zero return "continuous" distribution
51 $out = $begin + ($end-$begin)*$new_seed/$modulus; 51 $out = $begin + ($end-$begin)*$new_seed/$modulus;
52 } 52 }
53 $out; 53 $out;
54 54

Legend:
Removed from v.1079  
changed lines
  Added in v.1454

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9