# Tag Archives: Perl-Math-Functions

In Perl, sometimes there is a need to solve various expressions that contain some mathematical operations. These mathematical operations can be performed with the use… Read More
The exp function in Perl calculates “e” raised to the power of the real number taken as the parameter. Here “e” is Euler’s Number or… Read More
The hex function in Perl converts the given hexadecimal number ( of base 16 ) into its equivalent decimal number ( of base 10 ).… Read More
The srand() function in Perl helps rand() function to generate a constant value each time the program is run. This srand() function uses the same… Read More
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… Read More
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… Read More
rand() function in Perl returns a random fractional number between 0 and the positive number value passed to it, or 1 if no value is… Read More
log() function in Perl returns the natural logarithm of value passed to it. Returns \$_ if called without passing a value. log() function can be… Read More
int() function in Perl returns the integer part of given value. It returns \$_ if no value provided. Note that \$_ is default input which… Read More
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)… Read More
This function is used to calculate cosine of a VALUE or \$_ if VALUE is omitted. The VALUE should be expressed in radians. Syntax: cos(VALUE)… Read More
This function is used to calculate arctangent of Y/X in the range -PI to PI. Syntax: atan2(Y, X) Parameters: Y and X which are axis… Read More
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… Read More