19 return [floor($number / self::SPLIT_DIVISOR), fmod($number, self::SPLIT_DIVISOR)];
35 public static function BITAND($number1, $number2)
41 return $e->getMessage();
46 return self::SPLIT_DIVISOR * ($split1[0] & $split2[0]) + ($split1[1] & $split2[1]);
62 public static function BITOR($number1, $number2)
68 return $e->getMessage();
74 return self::SPLIT_DIVISOR * ($split1[0] | $split2[0]) + ($split1[1] | $split2[1]);
90 public static function BITXOR($number1, $number2)
96 return $e->getMessage();
102 return self::SPLIT_DIVISOR * ($split1[0] ^ $split2[0]) + ($split1[1] ^ $split2[1]);
124 return $e->getMessage();
127 $result = floor($number * (2 ** $shiftAmount));
154 return $e->getMessage();
157 $result = floor($number / (2 ** $shiftAmount));
176 if (is_numeric($value)) {
177 if ($value == floor($value)) {
178 if (($value > 2 ** 48 - 1) || ($value < 0)) {
182 return floor($value);
202 if (is_numeric($value)) {
203 if (abs($value) > 53) {
221 if ($number ===
null) {
223 } elseif (is_bool($number)) {
224 $number = (int) $number;
An exception for terminatinating execution or to throw for unit testing.
static validateBitwiseArgument($value)
Validate arguments passed to the bitwise functions.
static BITXOR($number1, $number2)
BITXOR.
static splitNumber($number)
Split a number into upper and lower portions for full 32-bit support.
static BITRSHIFT($number, $shiftAmount)
BITRSHIFT.
static BITAND($number1, $number2)
BITAND.
static BITOR($number1, $number2)
BITOR.
static validateShiftAmount($value)
Validate arguments passed to the bitwise functions.
static BITLSHIFT($number, $shiftAmount)
BITLSHIFT.
static nullFalseTrueToNumber(&$number)
Many functions accept null/false/true argument treated as 0/0/1.
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.