Perl | int() function Last Updated : 25 Jun, 2019 Comments Improve Suggest changes Like Article Like Report int() function in Perl returns the integer part of given value. It returns $_ if no value provided. Note that $_ is default input which is 0 in this case. The int() function does not do rounding. For rounding up a value to an integer, sprintf is used. Syntax: int(VAR) Parameters: VAR: value which is to be converted into integer Returns: Returns the integer part of VAR Example 1: Perl #!/usr/bin/perl # Passing positive decimal value $int_val = int(19.8547); print"Integer value is $int_val\n"; # Passing negative decimal value $int_val = int(-18.659); print"Integer value is $int_val\n"; Output: Integer value is 19 Integer value is -18 Example 2: Perl #!/usr/bin/perl # Passing fractional positive value $int_val = int(17 / 4); print"Integer value is $int_val\n"; # Passing fractional negative value $int_val = int(-17 / 4); print"Integer value is $int_val\n"; Output: Integer value is 4 Integer value is -4 Comment More infoAdvertise with us Next Article Perl | int() function C Code_Mech Follow Improve Article Tags : Perl Perl-function Perl-Math-Functions Similar Reads Perl | oct() Function oct() function in Perl converts the octal value passed to its respective decimal value. For example, oct('1015') will return '525'. This function returns the resultant decimal value in the form of a string which can be used as a number because Perl automatically converts a string to a number in nume 1 min read Perl | abs() function This function returns the absolute value of its argument. If a pure integer value is passed then it will return it as it is, but if a string is passed then it will return zero. If VALUE is omitted then it uses $_ Syntax: abs(VALUE) Parameter: VALUE: It is a required number which can be either positi 2 min read Perl | sin() Function This function is used to calculate sine of a VALUE or $_ if VALUE is omitted. This function always returns a floating point. Syntax: sin(VALUE) Parameters: VALUE in the form of float Returns: Function returns sine of VALUE. Example 1: Perl #!/usr/bin/perl # Calling sin() function $var = sin(5); # Pr 1 min read Perl | sqrt() Function Many times it happens that while solving mathematical expressions we require to calculate the square root of a number. To solve this issue, like other programming language Perl provides us with a built-in function sqrt() which can be used to calculate the square root of a number. Syntax: sqrt value 1 min read Perl | Math::BigInt->bone() method 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( 2 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->bfac() method Math::BigInt module in Perl provides objects that represent integers with arbitrary precision and overloaded arithmetical operators. bfac() method of Math::BigInt module is used to calculate factorial of a number stored as BigInt object. Syntax: Math::BigInt->bfac() Parameter: None Returns: a nor 2 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 | Number and its Types A Number in Perl is a mathematical object used to count, measure, and perform various mathematical operations. A notational symbol that represents a number is termed as a numeral. These numerals, in addition to their use in mathematical operations, are also used for ordering(in the form of serial nu 4 min read Perl | Math::BigInt->is_even() method 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 Re 2 min read Like