Lines Matching refs:x

77      * @param mixed $x integer Base-10 number or base-$base number if $base set.
82 public function __construct($x = 0, $base = 10) argument
92 parent::__construct($x, $base);
105 $x = (strlen($this->value) & 1) ? '0' . $this->value : $this->value;
106 $temp = new static(Hex::decode($x), 256);
115 $x = $this->value;
117 if ($x[0] == '-') {
119 $x = substr($x, 1);
122 $x = str_pad(
123 $x,
124 strlen($x) + ((static::MAX10LEN - 1) * strlen($x)) % static::MAX10LEN,
128 while (strlen($x)) {
130 … $temp = $temp->add(new static($this->int2bytes(substr($x, 0, static::MAX10LEN)), 256));
131 $x = substr($x, static::MAX10LEN);
549 $x = clone $this;
552 $x_sign = $x->is_negative;
555 $x->is_negative = $y->is_negative = false;
557 $diff = $x->compare($y);
569 $x = $y->subtract($x);
571 return [$this->normalize(static::$zero[static::class]), $this->normalize($x)];
579 $x->lshift($shift);
583 $x_max = count($x->value) - 1;
607 while ($x->compare($temp) >= 0) {
610 $x = $x->subtract($temp);
611 $x_max = count($x->value) - 1;
615 $x_value = &$x->value;
658 $x = $x->subtract($temp);
660 if ($x->compare(static::$zero[static::class]) < 0) {
662 $x = $x->add($temp);
671 $x->rshift($shift);
678 $x = $y->subtract($x);
681 return [$this->normalize($quotient), $this->normalize($x)];
715 * @param int $x
719 private static function safe_divide($x, $y) argument
722 return (int)($x / $y);
727 return ($x - ($x % $y)) / $y;
891 * @param int $x
894 private static function int2bytes($x) argument
896 return ltrim(pack('N', $x), chr(0));
1001 protected static function square(array $x) argument
1003 return count($x) < 2 * self::KARATSUBA_CUTOFF ?
1004 self::trim(self::baseSquare($x)) :
1005 self::trim(self::karatsubaSquare($x));
1185 public function testBit($x) argument
1187 $digit = (int) floor($x / static::BASE);
1188 $bit = $x % static::BASE;