Skip to Main Content
Perl Pocket Reference, 5th Edition
book

Perl Pocket Reference, 5th Edition

by Johan Vromans
July 2011
Intermediate to advanced content levelIntermediate to advanced
104 pages
2h 14m
English
O'Reilly Media, Inc.
Content preview from Perl Pocket Reference, 5th Edition

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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl Testing: A Developer's Notebook

Perl Testing: A Developer's Notebook

Ian Langworth, Chromatic
Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe

Publisher Resources

ISBN: 9781449311186Errata Page