Math::BigInt
Perl中的module提供了代表具有任意精度的整数和重载算术运算符的对象。
Math::BigInt模块的config()方法用于获取有关Perl模块的配置的信息。
用法: Math::BigInt->config()
参数:没有
返回:包含配置的哈希,例如类名,版本号,库等
范例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";
输出:
$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
范例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";
输出:
$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
相关用法
- perl Math::BigInt->bzero()用法及代码示例
- perl Math::BigInt->is_odd()用法及代码示例
- perl Math::BigInt->brsft()用法及代码示例
- perl Math::BigInt->from_oct()用法及代码示例
- perl Math::BigInt->length()用法及代码示例
- perl Math::BigInt->from_hex()用法及代码示例
- perl Math::BigInt->bneg()用法及代码示例
- perl Math::BigInt->bnan()用法及代码示例
- perl Math::BigInt->digit()用法及代码示例
- perl Math::BigInt->binf()用法及代码示例
- perl Math::BigInt->bone()用法及代码示例
- perl Math::BigInt->bfac()用法及代码示例
注:本文由纯净天空筛选整理自Code_Mech大神的英文原创作品 Perl | Math::BigInt->config() method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。