mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Implementing more usefull functions
This commit is contained in:
parent
f9214d65ec
commit
22d6040dca
|
|
@ -205,4 +205,28 @@ class Functions
|
|||
|
||||
return $t;
|
||||
}
|
||||
|
||||
public static function mod($a, $b) {
|
||||
if($a < 0) {
|
||||
return ($a + $b) % $b;
|
||||
}
|
||||
|
||||
return $a % $b;
|
||||
}
|
||||
|
||||
public static function isOdd($a) : int {
|
||||
if ($a & 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function isEven($a) : int {
|
||||
if ($a & 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user