mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
47 lines
790 B
PHP
47 lines
790 B
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.4
|
|
*
|
|
* @package phpOMS\Utils
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link https://orange-management.org
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace phpOMS\Utils;
|
|
|
|
/**
|
|
* Array utils.
|
|
*
|
|
* @package phpOMS\Utils
|
|
* @license OMS License 1.0
|
|
* @link https://orange-management.org
|
|
* @since 1.0.0
|
|
*/
|
|
final class NumericUtils
|
|
{
|
|
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @since 1.0.0
|
|
* @codeCoverageIgnore
|
|
*/
|
|
private function __construct()
|
|
{
|
|
}
|
|
|
|
public static function uRightShift(int $a, int $b) : int
|
|
{
|
|
if ($b === 0) {
|
|
return $a;
|
|
}
|
|
|
|
return ($a >> $b) & ~(1 << (8 * \PHP_INT_SIZE - 1)>>($b - 1));
|
|
}
|
|
}
|