Perl | Math::BigInt->binf() 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. 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->binf() Parameter: plus or minus: to set the sign of infinity as '+' or '-' Returns: object with value inf Example 1: perl #!/usr/bin/perl # Import Math::BigInt module use Math::BigInt; # Create a BigInt object $x = Math::BigInt->binf(); # Object created with binf() print("$x\n"); # Create a BigInt object $x = Math::BigInt->binf('-'); # Object created with binf() print("$x"); Output: inf -inf 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->binf(); # Object after function call print("After function call: $x"); Output: Before function call: 78215936043546 After function call: inf 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->binf('-'); # Object after function call print("After function call: $x"); Output: Before function call: 78215936043546 After function call: -inf Comment More info C Code_Mech Follow Improve Article Tags : Perl Perl-method Perl-Math-Functions Explore BasicsPerl Programming Language2 min readIntroduction to Perl7 min readPerl Installation and Environment Setup in Windows, Linux, and MacOS3 min readPerl | Basic Syntax of a Perl Program10 min readHello World Program in Perl3 min readFundamentalsPerl | Data Types3 min readPerl | Boolean Values3 min readPerl | Operators | Set - 112 min readPerl | Operators | Set - 27 min readPerl | Variables4 min readPerl | Modules3 min readPackages in Perl4 min readControl FlowPerl | Decision Making (if, if-else, Nestedâif, if-elsif ladder, unless, unless-else, unless-elsif)6 min readPerl | Loops (for, foreach, while, do...while, until, Nested loops)7 min readPerl | given-when Statement4 min readPerl | goto statement3 min readArrays & ListsPerl | Arrays6 min readPerl | Array Slices3 min readPerl | Arrays (push, pop, shift, unshift)3 min readPerl List and its Types4 min readHashPerl Hash4 min readPerl | Hash Operations8 min readPerl | Multidimensional Hashes6 min readScalarsPerl | Scalars2 min readPerl | Comparing Scalars6 min readPerl | scalar keyword2 min readStringsPerl | Quoted, Interpolated and Escaped Strings4 min readPerl | String Operators4 min readPerl | String functions (length, lc, uc, index, rindex)4 min readOOP ConceptsObject Oriented Programming (OOPs) in Perl7 min readPerl | Classes in OOP6 min readPerl | Objects in OOPs6 min readPerl | Methods in OOPs5 min readPerl | Constructors and Destructors4 min readPerl | Method Overriding in OOPs6 min readPerl | Inheritance in OOPs7 min readPerl | Polymorphism in OOPs4 min readPerl | Encapsulation in OOPs6 min readRegular ExpressionsPerl | Regular Expressions2 min readPerl | Operators in Regular Expression4 min readPerl | Regex Character Classes3 min readPerl | Quantifiers in Regular Expression4 min readFile HandlingPerl | File Handling Introduction7 min readPerl | Opening and Reading a File4 min readPerl | Writing to a File3 min readPerl | Useful File-handling functions2 min read Like