Open In App

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

Last Updated : 03 Oct, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

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:




#!/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";


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:




#!/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";


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

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads