Creates the union of A and B.

@param Set $a
@param Set $b

@return Set
495926
public static function union(Set $a, Set $b) : Set
    {
        return new self(array_merge($a->toArray(), $b->toArray()));
    }
852627
public function coprime($a, $b)
    {
        list($a, $b) = array($this->bcNormalize($a), $this->bcNormalize($b));

        try {

            while ($this->coCompare($a, $b)) {
                list($a, $b) = $this->coSwitch($a, $b);
            }

        } catch (\Exception $e) {
            throw $e;
        }

        return (bccomp($a, '1') == 0) ? true : false;
    }
255589
function(or, and) {
			var aDiff = set.difference(or, and.values[0]);
			var bDiff = set.difference(or, and.values[1]);
			return set.union(aDiff, bDiff);
		}
1371140
def union(a, b):
    """"""
    a = find(a)
    b = find(b)
    if a is not b:
        if a.rank < b.rank:
            a.parent = b
        elif b.rank < a.rank:
            b.parent = a
        else:
            b.parent = a
            a.rank += 1
327634
public function union ($set) {
        if (is_array ($set)) {
            $parameters = $set;
        } else {
            $parameters = func_get_args ();
        }
        foreach ($parameters as $n => $set) {
            if ($set instanceof ARedisSet) {
                $parameters[$n] = $set->name;
            }
        }
        array_unshift ($parameters , $this->name);
        return call_user_func_array (array(
            $this->getConnection ()->getSlave(),
            "sunion"
        ) , $parameters);
    }
1307803
protected function mixColors(Color $a, Color $b): Color {
        $alpha = $this->a($b) + (1 - $this->a($b)) * $this->a($a);

        // To avoid divide on zero
        if ($alpha == 0) {
            return new Color(0, 0, 0, 0);
        }

        $k = $this->a($b) / $alpha;

        return new Color(
            $a->r() + ($b->r() - $a->r()) * $k,
            $a->g() + ($b->g() - $a->g()) * $k,
            $a->b() + ($b->b() - $a->b()) * $k,
            $alpha
        );
    }
896782
public static function merge($a, $b)
    {
        $acon = static::parse($a);
        $bcon = static::parse($b);

        if ($acon instanceof EmptyConstraint) {
            return $b;
        } elseif ($bcon instanceof EmptyConstraint) {
            return $a;
        } elseif ($acon->matches($bcon) || $bcon->matches($acon)) {
            return strlen($a) > strlen($b) ? $b : $a;
        } else {
            return $a . ' ' . $b;
        }
    }
452886
function union(Set $that) {
        $union = $this->cloneEmpty();

        $this->for_each($this, [$union, 'add']);
        $this->for_each($that, [$union, 'add']);

        return $union;
    }
325073
def union(self, key, *others):
        """"""
        if not isinstance(key, str):
            raise ValueError("String expected.")
        self.db.sunionstore(key, [self.key] + [o.key for o in others])
        return Set(key)
1370853
public function add($a, $b)
    {
        $a = $this->convert($a);
        $b = $this->convert($b);

        switch ($this->arbitrate($a, $b)) {
            case 'int':
                return $this->calcEngine->intAdd($a, $b);
            case 'float':
                return $this->calcEngine->floatAdd($a, $b);
            case 'whole':
                return $this->calcEngine->wholeAdd($a, $b);
            case 'natural':
                return $this->calcEngine->naturalAdd($a, $b);
            case 'rational':
                return $this->calcEngine->rationalAdd($a, $b);
            case 'complex':
                return $this->calcEngine->complexAdd($a, $b);
            case 'complex:numeric':
                return $this->calcEngine->complexAdd($a, $b->asComplex());
            case 'numeric:complex':
                return $this->calcEngine->complexAdd($a->asComplex(), $b);
        }
    }
15622
public function union($collection)
    {
        $union = clone $this;

        /** @var ModelInterface $otherModel */
        foreach ($collection->diff($this) as $otherModel) {
            $union->push($otherModel);
        }

        return $union;
    }
36003
public static <E> Set<E> union(Set<E> s1, Set<E> s2) {
    Set<E> s = new HashSet<E>();
    s.addAll(s1);
    s.addAll(s2);
    return s;
  }
1265233
public static function add($a, $b)
    {
        if (function_exists('gmp_add')) {
            return gmp_add($a, $b);
        }

        return bcadd($a, $b, 0);
    }
91196
public static boolean sameSet(final Object[] a, final Vector b) {
    if (a == null || b == null || a.length != b.size()) {
      return false;
    }
    if (a.length == 0) {
      return true;
    }
    // Convert the array into a set
    final Hashtable t = new Hashtable();
    for (final Object element : a) {
      t.put(element, element);
    }
    for (int i = 0; i < b.size(); i++) {
      final Object o = b.elementAt(i);
      if (t.remove(o) == null) {
        return false;
      }
    }
    return t.size() == 0;
  }
1361496
public function mul($a, $b)
    {
        $a = $this->convert($a);
        $b = $this->convert($b);
        switch ($this->arbitrate($a, $b)) {
            case 'int':
                return $this->calcEngine->intMul($a, $b);
            case 'float':
                return $this->calcEngine->floatMul($a, $b);
            case 'whole':
                return $this->calcEngine->wholeMul($a, $b);
            case 'natural':
                return $this->calcEngine->naturalMul($a, $b);
            case 'rational':
                return $this->calcEngine->rationalMul($a, $b);
            case 'complex':
                return $this->calcEngine->complexMul($a, $b);
            case 'complex:numeric':
                return $this->calcEngine->complexMul($a, $b->asComplex());
            case 'numeric:complex':
                return $this->calcEngine->complexMul($a->asComplex(), $b);
        }
    }
197898
protected function merge(Subheap $a, Subheap $b) // -> &Subheap
	{
		$p = $b;
		$c = $a;
		
		if(0 < $this->compare($a->data, $b->data))
		{
			$p = $a;
			$c = $b;
		}
		
		$p->subheaps[$c->tag] = $c;
		$c->parent            = $p;
		
		return $p;
	}
14490
public function union($a, $b)
	{
		$ar = $this->find($a);
		$br = $this->find($b);

		if ($ar !== $br) {
			$this->parents[$br] = $ar;
		}

		/*
		$c = function($x) {
			return sprintf('<span style="background:#%x">%s</span>', crc32($x) & 0xffffff | 0x808080, $x);
		};

		echo '<br><b>', $c($a), ' == ', $c($b), "</b><br>";
		var_dump($this->parents);
		echo '    ', $c($a), ' … ', ($ar === $this->parents[$ar] ? $c($ar).' is root' : '<b>'.$c($ar).' is NOT root!</b>'), "<br>";
		echo '    ', $c($b), ' … ', ($br === $this->parents[$br] ? $c($br).' is root' : '<b>'.$c($br).' is NOT root!</b>'), "<br>";
		echo '    ', $c($ar), ' =?= ', $c($br), "<br>";
		echo '    ', $c($br), ' --&gt; ', $c($this->parents[$br]), "<br>";
		// */
	}