\Tazorax\MathUtils\ArithmeticUtils

Class Utils

Summary

Methods
Properties
Constants
gcd()
lcm()
lcmArray()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

gcd()

gcd(integer  $n, integer  $m) : integer

Calculate GCD between 2 integers

Parameters

integer $n

First integer

integer $m

Second integer

Returns

integer —

GCD of first and second integer

lcm()

lcm(integer  $n, integer  $m) : integer

Calculate LCM between 2 integers

Parameters

integer $n

First integer

integer $m

Second integer

Returns

integer —

LCM of first and second integer

lcmArray()

lcmArray(array<mixed,integer>  $numbers) : integer

Calculate LCM from multiple integers

Parameters

array<mixed,integer> $numbers

Integers array to calculate

Returns

integer —

LCM of all integers