Perl | Math::BigInt->bone() method Last Updated : 03 Oct, 2019 Comments Improve Suggest changes Like Article Like Report Math::BigInt module in Perl provides objects that represent integers with arbitrary precision and overloaded arithmetical operators. bone() method of Math::BigInt module is used to create a new object with value one and if used on an existing object, it sets it to one. Syntax: Math::BigInt->bone() Parameter: plus or minus: to set the sign of one as '+' or '-' Returns: object with value one Example 1: perl #!/usr/bin/perl # Import Math::BigInt module use Math::BigInt; # Create a BigInt object $x = Math::BigInt->bone(); # Object created with bone() print("$x\n"); # Create a BigInt object $x = Math::BigInt->bone('-'); # Object created with bone() print("$x"); Output: 1 -1 Example 2: perl #!/usr/bin/perl # Import Math::BigInt module use Math::BigInt; # Specify number $num = 78215936043546; # Create BigInt object $x = Math::BigInt->new($num); # Object before function call print("Before function call: $x\n"); # Calling the function $x->bone(); # Object after function call print("After function call: $x"); Output: Before function call: 78215936043546 After function call: 1 Example 3: perl #!/usr/bin/perl # Import Math::BigInt module use Math::BigInt; # Specify number $num = 78215936043546; # Create BigInt object $x = Math::BigInt->new($num); # Object before function call print("Before function call: $x\n"); # Calling the function with '-' sign $x->bone('-'); # Object after function call print("After function call: $x"); Output: Before function call: 78215936043546 After function call: -1 Comment More infoAdvertise with us Next Article Perl | Math::BigInt->config() method C Code_Mech Follow Improve Article Tags : Perl Perl-method Perl-Math-Functions Similar Reads Perl | Math::BigInt->bneg() method Math::BigInt module in Perl provides objects that represent integers with arbitrary precision and overloaded arithmetical operators. bneg() method of Math::BigInt module is used to change the value of input to its negative value and does nothing for zero or NAN values Syntax: Math::BigInt->bneg() 1 min read Perl | Math::BigInt->binf() method Math::BigInt module in Perl provides objects that represent integers with arbitrary precision and overloaded arithmetical operators. binf() method of Math::BigInt module is used to create a new object with value infinity and if used on an existing object, it sets it to infinity. Syntax: Math::BigInt 2 min read Perl | Math::BigInt->bnan() method Math::BigInt module in Perl provides objects that represent integers with arbitrary precision and overloaded arithmetical operators. bnan() method of Math::BigInt module is used to create a new object with value NAN and if used on an existing object, it converts it to NAN. Syntax: Math::BigInt->b 1 min read Perl | Math::BigInt->bzero() method Math::BigInt module in Perl provides objects that represent integers with arbitrary precision and overloaded arithmetical operators. bzero() method of Math::BigInt module is used to create a new object with value zero and if used on an existing object, it sets it to zero. Syntax: Math::BigInt->bz 1 min read 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 Ret 1 min read Perl | Math::BigInt->brsft() method Math::BigInt module in Perl provides objects that represent integers with arbitrary precision and overloaded arithmetical operators.brsft() method of Math::BigInt module is used to right shift the given value by a base given as parameter. Syntax: Math::BigInt->brsft()Parameter: $y- number of time 1 min read Like