Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

1. Perl Pocket Reference > Arithmetic Functions

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.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint