Provides standard math functions.
The following statement may be used to import the math library:
import math;
Name | Description |
---|---|
seed_random | Seed the random number generator using system time |
get_random | Get a random integer |
int_to_double | Convert an integer to a double |
double_to_int | Convert a double to an integer |
int_to_long | Convert an integer to a long |
long_to_int | Convert a long to an integer |
long_to_double | Convert a long to a double |
double_to_long | Convert a double to a long |
call seed_random;
int rand;
call get_random -> rand;
int iToD = 5;
double tempDouble;
call int_to_double : iToD -> tempDouble;
int dToI = -1;
double tempDouble;
call double_to_int : tempDouble -> dToI;
int toLong = 12345;
long l;
call int_to_long : toLong -> l;
long toInt = 349674032692;
int i;
call long_to_int : toInt -> i;
long toDouble = 122334;
double d;
call long_to_double : toDouble -> d;
double toLong = 3.14;
long l;
call double_to_long : toLong -> l;