Guest User

Untitled

a guest
Feb 19th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.29 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use Math::BigRat;
  3.  
  4. for (my $n=1; $n <5;$n++)
  5. {
  6.  my $binomial = Math::BigRat->new($n);
  7.  
  8.  for (my $j=1; $j<=$n;$j++)
  9.  {
  10.   $binomial->bnok($j);
  11.   my $binomial_coefficient = $binomial->as_float();
  12.   print "$n.C.$j = " . $binomial_coefficient;
  13.   print " ";
  14.  }
  15. print "\n";
  16. }
Add Comment
Please, Sign In to add comment