NAME

math.ops - Mathematical Opcodes

DESCRIPTION

Parrot's library of mathematical ops.

To use this library of ops, add this directive to your PIR:

 .loadlib 'math_ops'
rand(out NUM)
Set $1 to a random floating point number between 0 and 1, inclusive.
rand(out INT)
Set $1 to a random integer between [-2^31, 2^31) .
rand(out NUM, in NUM)
Set $1 to a random floating point number between 0 and and $2, inclusive.
rand(out INT, in INT)
Set $1 to a integer between 0 and and $2, inclusive.
rand(out NUM, in NUM, in NUM)
Set $1 to a random floating point number between $2 and and $3, inclusive.
srand(in NUM)
Set the random number seed to $1. $1 is casted to an INTVAL.
srand(in INT)
Set the random number seed to $1.
rand(out INT, in INT, in INT)
Set $1 to a integer between $2 and and $3, inclusive.

COPYRIGHT

Copyright (C) 2001-2009, Parrot Foundation.

LICENSE

This program is free software. It is subject to the same license as the Parrot interpreter itself.