[system] / trunk / pg / macros / PGauxiliaryFunctions.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/PGauxiliaryFunctions.pl

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

Revision 2576 Revision 2957
198sub C { 198sub C {
199 my $n = shift; 199 my $n = shift;
200 my $k = shift; 200 my $k = shift;
201 my $ans = 1; 201 my $ans = 1;
202 202
203 return(0) if ($k>$n);
203 if($k>($n-$k)) { $k = $n-$k; } 204 if($k>($n-$k)) { $k = $n-$k; }
204 for (1..$k) { $ans = ($ans*($n-$_+1))/$_; } 205 for (1..$k) { $ans = ($ans*($n-$_+1))/$_; }
205 return $ans; 206 return $ans;
206} 207}
207 208

Legend:
Removed from v.2576  
changed lines
  Added in v.2957

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9