Perl | Math::BigInt->config() method

Math::BigInt module in Perl provides objects that represent integers with arbitrary precision and overloaded arithmetical operators.

config() method of Math::BigInt module is used to get the information about the configuration of the Perl module.

Syntax: Math::BigInt->config()



Parameter: None

Returns: a hash containing the configuration, e.g.class name, the version number, library, etc.

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

#!/usr/bin/perl 
  
# Import Data Dumper Module
use Data::Dumper;
  
# Import Math::BigInt module 
use Math::BigInt; 
  
print Dumper(Math::BigInt->config());
  
print Math::BigInt->config()->{version}, "\n";

chevron_right


Output:

$VAR1 = {
          'precision' => undef,
          'upgrade' => undef,
          'accuracy' => undef,
          'div_scale' => 40,
          'trap_nan' => 0,
          'lib_version' => '1.9997',
          'trap_inf' => 0,
          'version' => '1.9997',
          'round_mode' => 'even',
          'lib' => 'Math::BigInt::Calc',
          'class' => 'Math::BigInt',
          'downgrade' => undef
        };
1.9997

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

#!/usr/bin/perl 
  
# Import Data Dumper Module
use Data::Dumper;
  
# Import Math::BigInt module 
use Math::BigInt; 
  
print Dumper(Math::BigInt->config());
  
print Math::BigInt->config()->{lib}, "\n";

chevron_right


Output:

$VAR1 = {
          'lib' => 'Math::BigInt::Calc',
          'class' => 'Math::BigInt',
          'accuracy' => undef,
          'upgrade' => undef,
          'round_mode' => 'even',
          'div_scale' => 40,
          'trap_nan' => 0,
          'lib_version' => '1.9997',
          'version' => '1.9997',
          'precision' => undef,
          'trap_inf' => 0,
          'downgrade' => undef
        };
Math::BigInt::Calc


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.