Lines Matching refs:value

91         $this->value = [];
105 $x = (strlen($this->value) & 1) ? '0' . $this->value : $this->value;
107 $this->value = $temp->value;
113 $multiplier->value = [static::MAX10];
115 $x = $this->value;
134 $this->value = $temp->value;
160 if (!count($this->value)) {
169 $divisor->value = [static::MAX10];
171 while (count($temp->value)) {
174 isset($mod->value[0]) ? $mod->value[0] : '',
204 if (!count($this->value)) {
265 $value = $y_value;
268 $value = $x_value;
271 $value[count($value)] = 0; // just in case the carry adds an extra digit
282 …$value[$i] = (int)($sum - static::BASE_FULL * $temp); // eg. a faster alternative to fmod($sum, 0x…
283 $value[$j] = $temp;
289 $value[$i] = $carry ? $sum - static::BASE_FULL : $sum;
294 for (; $value[$i] == static::MAX_DIGIT; ++$i) {
295 $value[$i] = 0;
297 ++$value[$i];
301 self::VALUE => self::trim($value),
539 if (count($y->value) == 1) {
540 list($q, $r) = $this->divide_digit($this->value, $y->value[0]);
543 $quotient->value = $q;
544 $remainder->value = [$r];
561 $temp->value = [1];
575 $msb = $y->value[count($y->value) - 1];
581 $y_value = &$y->value;
583 $x_max = count($x->value) - 1;
584 $y_max = count($y->value) - 1;
587 $quotient_value = &$quotient->value;
601 $temp_value = &$temp->value;
602 $rhs_value = &$rhs->value;
611 $x_max = count($x->value) - 1;
615 $x_value = &$x->value;
638 $lhs->value = [$quotient_value[$q_index]];
646 $lhs->value = [$quotient_value[$q_index]];
653 $temp_value = &$temp->value;
739 $result->value = $arr[self::VALUE];
758 $value = &$result->value;
760 if (!count($value)) {
765 $value = static::trim($value);
767 if (!empty($result->bitmask->value)) {
768 $length = min(count($value), count($result->bitmask->value));
769 $value = array_slice($value, 0, $length);
772 $value[$i] = $value[$i] & $result->bitmask->value[$i];
775 $value = static::trim($value);
824 $temp->value = $this->value;
837 protected static function trim(array $value) argument
839 for ($i = count($value) - 1; $i >= 0; --$i) {
840 if ($value[$i]) {
843 unset($value[$i]);
846 return $value;
863 $temp->value = $this->value;
882 $temp->value = $this->value;
930 for ($i = 0; $i < count($this->value); ++$i) {
931 $temp = $this->value[$i] * $shift + $carry;
933 $this->value[$i] = (int)($temp - $carry * static::BASE_FULL);
937 $this->value[count($this->value)] = $carry;
941 array_unshift($this->value, 0);
964 $this->value = array_slice($this->value, $num_digits);
969 for ($i = count($this->value) - 1; $i >= 0; --$i) {
970 $temp = $this->value[$i] >> $shift | $carry;
971 $carry = ($this->value[$i] & $carry_mask) << $carry_shift;
972 $this->value[$i] = $temp;
975 $this->value = static::trim($this->value);
1015 * @param array $value
1018 protected static function baseSquare(array $value) argument
1020 if (empty($value)) {
1023 $square_value = self::array_repeat(0, 2 * count($value));
1025 for ($i = 0, $max_index = count($value) - 1; $i <= $max_index; ++$i) {
1028 $temp = $square_value[$i2] + $value[$i] * $value[$i];
1034 $temp = $square_value[$k] + 2 * $value[$j] * $value[$i] + $carry;
1053 * @param array $value
1056 protected static function karatsubaSquare(array $value) argument
1058 $m = count($value) >> 1;
1061 return self::baseSquare($value);
1064 $x1 = array_slice($value, $m);
1065 $x0 = array_slice($value, 0, $m);
1093 $this->value[0] |= 1;
1103 if ($this->value == [1]) {
1106 if ($this->value == [2]) {
1109 if (~$this->value[0] & 1) {
1113 $value = $this->value;
1115 list(, $r) = self::divide_digit($value, $prime);
1117 return count($value) == 1 && $value[0] == $prime;
1135 $r_value = &$r->value;
1177 return (bool)($this->value[0] & 1);
1190 if (!isset($this->value[$digit])) {
1194 return (bool)($this->value[$digit] & (1 << $bit));
1241 $temp->value = $digit != 0 ? [$digit] : [];
1247 $val = $this->value;
1284 $temp->value = static::trim($digit);
1300 $val = $this->value;