Advertisement
cd62131

BigFloat

Feb 2nd, 2014
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.42 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use Math::BigFloat try => 'GMP';
  5. use feature 'say';
  6.  
  7. Math::BigFloat->div_scale(60);
  8. say my $x1 = Math::BigFloat->new('-7.0E1')->bexp();
  9. say my $x2 = Math::BigFloat->new('-7.05E1')->bexp();
  10. say my $x3 = Math::BigFloat->new('-8.0E1')->bexp();
  11. my @a = ($x1, $x2, $x3);
  12. foreach (@a) {
  13.   my $one = Math::BigFloat->bone();
  14.   say $one->copy()->bdiv($one->copy()->badd($_));
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement