Math::BigInt module in Perl provides objects that represent integers with arbitrary precision and overloaded arithmetical operators.
is_even() method of
Math::BigInt module is used to check whether a number stored as
BigInt object is even or not.
Syntax: Math::BigInt->is_even()
Parameter: None
Returns: true if the number stored in BigInt object is an even number, otherwise returns false.
Example 1: Use of
Math::BigInt->is_even() method
Output:
89132506319263974586 is an even number
98793270075788553683446589224555431 is not an even number
Example 2: Use of
Math::BigInt->is_even() method to check whether a hexadecimal number is an even number in decimal or not.
Output:
0x24CB016EA is an even number in decimal
Example 3: Use of
Math::BigInt->is_even() method to check whether a binary number is an even number in decimal or not.
Output:
0b1001001100101100000001011011101010 is an even Number in decimal