MeatAxe: Miscellaneous

MeatAxe 2.4

- Main Page
- Related Pages
- Modules
- Data Structures

Functions
Miscellaneous

## Functions
long | gcd (long a, long b)
| Greatest Common Divisor.
long | lcm (long a, long b)
| Least Common Multiple.
void | MtxRandomInit (unsigned x)
| Initialize the random number generator.
long | MtxRandom (void)
| Get the next (Pseudo-)Random number.
int | MtxRandomInt (int max)
| Random number.

## Function Documentation

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.

Parameters:

  a | First number.
  b | Second number.

Returns:
  Greatest common divisor of a and b.

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.

Parameters:

  a | First number.
  b | Second number.

Returns:
  Least common multiple of a and b.

long MtxRandom | ( | void |  | ) |

Get the next (Pseudo-)Random number.

This function returns a nonnegative (pseudo) random number.

Returns:
  Pseudo random number.

void MtxRandomInit | ( | unsigned | x | ) |

Initialize the random number generator.

Parameters:

  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.

Returns:
  Pseudo random number.