Arithmetic Functions
- abs exprâ
Returns the absolute value of its operand.
- atan2 y
,
x Returns the arctangent of y/x in the range to .
- cos exprâ
Returns the cosine of expr (expressed in radians).
- exp exprâ
Returns e to the power of expr.
- int exprâ
Returns the integer portion of expr.
- log exprâ
Returns the natural logarithm (base e) of expr.
- rand [ expr ]
Returns a random fractional number between 0 (inclusive) and the value of expr (exclusive). If expr is omitted, it defaults to 1.
- sin exprâ
Returns the sine of expr (expressed in radians).
- sqrt exprâ
Returns the square root of expr.
- srand [ expr ]
Sets the random number seed for the rand operator.
- time
Returns the number of nonleap seconds since whatever time the system considers to be the epoch. Suitable for feeding to gmtime and localtime.
Get Perl Pocket Reference, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.