Round up the the next multiple.

    :param n: The number to round up.
    :param m: The multiple.
    :return: The rounded number
510727
def _round_to_next_multiple(n, m):
    
    return n if n % m == 0 else n + m - n % m
248884
public static int ceiling(int n, int m) {
        return n >= 0 ? ((n + m - 1) / m) * m : (n / m) * m;
    }
433500
def set(self, num):
        
        self._value = str(round(float(num), self.nplaces))
        self._variable.set(self._value)
638752
def _increment(self, n=1):
        """"""
        if self._cur_position >= self.num_tokens-1:
            self._cur_positon = self.num_tokens - 1
            self._finished = True
        else:
            self._cur_position += n
1115510
def round_to_n(x, n):
    
    return round(x, -int(np.floor(np.log10(x))) + (n - 1))
322243
def _round(num):
    
    deci = num - math.floor(num)
    if deci > 0.8:
        return int(math.floor(num) + 1)
    else:
        return int(math.floor(num))
398848
public RoundedMoney pow(int n) {
        MathContext mc = monetaryContext.get(MathContext.class);
        if(mc==null){
            mc = MathContext.DECIMAL64;
        }
        return new RoundedMoney(number.pow(n, mc),
                currency, rounding).with(rounding);
    }
585804
private void mmuli(int n, double[] A, double[] B, double[] C) {
        for (int i = 0; i < n * n; i++) {
            C[i] = 0;
        }

        for (int j = 0; j < n; j++) {
            int jn = j * n;
            for (int k = 0; k < n; k++) {
                int kn = k * n;
                double bkjn = B[k + jn];
                for (int i = 0; i < n; i++) {
                    C[i + jn] += A[i + kn] * bkjn;
                }
            }
        }
    }
1358570
def algorithm_u(ns, m):
    
    def visit(nv, av):
        ps = [[] for _ in range(m)]
        for jv in range(nv):
            ps[av[jv + 1]].append(ns[jv])
        return ps

    def f(mu, nu, sigma, n, a):
        if mu == 2:
            yield visit(n, a)
        else:
            for v in f(mu - 1, nu - 1, (mu + sigma) % 2, n, a):
                yield v
        if nu == mu + 1:
            a[mu] = mu - 1
            yield visit(n, a)
            while a[nu] > 0:
                a[nu] = a[nu] - 1
                yield visit(n, a)
        elif nu > mu + 1:
            if (mu + sigma) % 2 == 1:
                a[nu - 1] = mu - 1
            else:
                a[mu] = mu - 1
            if (a[nu] + sigma) % 2 == 1:
                for v in b(mu, nu - 1, 0, n, a):
                    yield v
            else:
                for v in f(mu, nu - 1, 0, n, a):
                    yield v
            while a[nu] > 0:
                a[nu] = a[nu] - 1
                if (a[nu] + sigma) % 2 == 1:
                    for v in b(mu, nu - 1, 0, n, a):
                        yield v
                else:
                    for v in f(mu, nu - 1, 0, n, a):
                        yield v

    def b(mu, nu, sigma, n, a):
        if nu == mu + 1:
            while a[nu] < mu - 1:
                yield visit(n, a)
                a[nu] = a[nu] + 1
            yield visit(n, a)
            a[mu] = 0
        elif nu > mu + 1:
            if (a[nu] + sigma) % 2 == 1:
                for v in f(mu, nu - 1, 0, n, a):
                    yield v
            else:
                for v in b(mu, nu - 1, 0, n, a):
                    yield v
            while a[nu] < mu - 1:
                a[nu] = a[nu] + 1
                if (a[nu] + sigma) % 2 == 1:
                    for v in f(mu, nu - 1, 0, n, a):
                        yield v
                else:
                    for v in b(mu, nu - 1, 0, n, a):
                        yield v
            if (mu + sigma) % 2 == 1:
                a[nu - 1] = 0
            else:
                a[mu] = 0
        if mu == 2:
            yield visit(n, a)
        else:
            for v in b(mu - 1, nu - 1, (mu + sigma) % 2, n, a):
                yield v

    ng = len(ns)
    ag = [0] * (ng + 1)
    for j in range(1, m + 1):
        ag[ng - m + j] = j - 1
    return f(m, ng, 0, ng, ag) if m > 1 else [[ns]]
821502
function matrMult(m, v) {

  return [
  new Fraction(m[0]).mul(v[0]).add(new Fraction(m[1]).mul(v[1])),
  new Fraction(m[2]).mul(v[0]).add(new Fraction(m[3]).mul(v[1]))
  ];
}
3386
def _n_2(self):
        """"""
        return (self._f(3, 1) * self._f(2, 1) +
                self._f(3, 0) * self._f(1, 3) * self._f(2, 1) +
                self._f(3, 0) * self._f(2, 0) * self._f(1, 2))
220737
def random(self, n: Optional[int] = None) -> Union[List[float], float]:
        
        return self._generate_randoms(self._request_randoms, max_n=self.config.MAX_NUMBER_OF_FLOATS,
                                      n=n)
142446
def next_up(x, context=None):
    
    x = BigFloat._implicit_convert(x)
    # make sure we don't alter any flags
    with _saved_flags():
        with (context if context is not None else EmptyContext):
            with RoundTowardPositive:
                # nan maps to itself
                if is_nan(x):
                    return +x

                # round to current context; if value changes, we're done
                y = +x
                if y != x:
                    return y

                # otherwise apply mpfr_nextabove
                bf = y.copy()
                mpfr.mpfr_nextabove(bf)
                # apply + one more time to deal with subnormals
                return +bf
760165
public static function uniform(int $m, int $n) : self
    {
        if ($m < 1 or $n < 1) {
            throw new InvalidArgumentException('Dimensionality must be'
                . ' greater than 0 on all axes.');
        }

        $a = [];

        for ($i = 0; $i < $m; $i++) {
            $temp = [];

            for ($j = 0; $j < $n; $j++) {
                $temp[] = rand(-PHP_INT_MAX, PHP_INT_MAX) / PHP_INT_MAX;
            }

            $a[] = $temp;
        }

        return self::quick($a);
    }
1051619
public void update(double p, long m)
    {
        Long mi = bin.get(p);
        if (mi != null)
        {
            // we found the same p so increment that counter
            bin.put(p, mi + m);
        }
        else
        {
            bin.put(p, m);
            // if bin size exceeds maximum bin size then trim down to max size
            while (bin.size() > maxBinSize)
            {
                // find points p1, p2 which have smallest difference
                Iterator<Double> keys = bin.keySet().iterator();
                double p1 = keys.next();
                double p2 = keys.next();
                double smallestDiff = p2 - p1;
                double q1 = p1, q2 = p2;
                while (keys.hasNext())
                {
                    p1 = p2;
                    p2 = keys.next();
                    double diff = p2 - p1;
                    if (diff < smallestDiff)
                    {
                        smallestDiff = diff;
                        q1 = p1;
                        q2 = p2;
                    }
                }
                // merge those two
                long k1 = bin.remove(q1);
                long k2 = bin.remove(q2);
                bin.put((q1 * k1 + q2 * k2) / (k1 + k2), k1 + k2);
            }
        }
    }
570673
def ynnm(n, m):
    """""" 
    a = 1.0 / np.sqrt(4.0 * np.pi)
    pm = np.abs(m)

    out = 0.0

    if(n < pm):
        out = 0.0
    elif(n == 0):
        out = a
    else:
        out = a
        for k in xrange(1, n + 1):
            out *= np.sqrt((2.0 * k + 1.0) / 8.0 / k)

        if(n != pm):
            for k in xrange(n - 1, pm - 1, -1):
                out *= np.sqrt((n + k + 1.0) / (n - k))
    return out
786874
def _round(self, multiple=1):
        
        for pair, value in self.items():
            value = int(normalizers.normalizeRounding(
                value / float(multiple))) * multiple
            self[pair] = value