SharedMeatAxe
1.0
|
Functions | |
long | gcd (long a, long b) |
Greatest Common Divisor. More... | |
long | lcm (long a, long b) |
Least Common Multiple. More... | |
void | MtxRandomInit (unsigned x) |
Initialize the random number generator. More... | |
long | MtxRandom (void) |
Get the next (Pseudo-)Random number. More... | |
int | MtxRandomInt (int max) |
Random number. More... | |
long gcd | ( | long | a, |
long | b | ||
) |
Greatest Common Divisor.
This function returns the greatest common divisor of two integers. If both numbers are positive, the result is positive. If one or both numbers are negative, the result may be positive or negative. If one of the numbers is zero, the function returns the other number. If both numbers are zero, the result is zero.
a | First number. |
b | Second number. |
long lcm | ( | long | a, |
long | b | ||
) |
Least Common Multiple.
This function returns the least common multiple of two integers. If both numbers are positive, the result is positive. If one or both numbers are negative, the result may be positive or negative. If both numbers are zero, a division by zero occurs.
a | First number. |
b | Second number. |
long MtxRandom | ( | void | ) |
Get the next (Pseudo-)Random number.
This function returns a nonnegative (pseudo) random number.
void MtxRandomInit | ( | unsigned | x | ) |
Initialize the random number generator.
x | Seed value. |
int MtxRandomInt | ( | int | max | ) |
Random number.
This function returns a (pseudo) random number in the range 0...max. The argument must be greater than 0.