Ceiling function (round towards positive infinity)
327121
def ceil(x):
    
    if isinstance(x, UncertainFunction):
        mcpts = np.ceil(x._mcpts)
        return UncertainFunction(mcpts)
    else:
        return np.ceil(x)
734959
function rounddeg(angle) {
    var result = 360.0 * (angle / 360.0 - Math.floor(angle / 360.0));
    if (result < 0.0) {
        result += 360.0;
    }
    if (result >= 360.0) {
        result -= 360.0;
    }
    return result;
}
161057
function round(out, a) {
  out[0] = Math.round(a[0]);
  out[1] = Math.round(a[1]);
  out[2] = Math.round(a[2]);
  return out;
}
983745
function hslToRgb(h, s, l, a, out) {
		function hueToRgb(m1, m2, h) {
			h = h % 1;
			if (h < 0) {
				h += 1;
			}
			if (h < 1 / 6) {
				return m1 + (m2 - m1) * h * 6;
			}
			if (h < 1 / 2) {
				return m2;
			}
			if (h < 2 / 3) {
				return m1 + (m2 - m1) * (2/3 - h) * 6;
			}
			return m1;
		}

		var m1, m2;
		if (l < 0.5) {
			m2 = l * (s + 1);
		} else {
			m2 = l + s - l * s;
		}
		m1 = l * 2 - m2;

		if (!out) {
			out = [];
		}

		out[0] = hueToRgb(m1, m2, h + 1/3);
		out[1] = hueToRgb(m1, m2, h);
		out[2] = hueToRgb(m1, m2, h - 1/3);
		out[3] = a;

		return out;
	}
740944
def si_round(val):
    '''
    
    '''
    if val < 0:
        neg = True
        val = -val
    elif val == 0:
        return 0, 0
    else:
        neg = False
    exp = math.log(val) / math.log(1000)
    if exp < 0:
        exp = int(exp) - 1
    else:
        exp = int(exp)
    val = val / 1000.0 ** exp
    if neg:
        val = -val
    return val, 3 * exp
1374683
def _call(self, x):
        """"""

        sum_constr = abs(x.ufuncs.sum() / self.diameter - 1) <= self.sum_rtol

        nonneq_constr = x.ufuncs.greater_equal(0).asarray().all()

        if sum_constr and nonneq_constr:
            return 0
        else:
            return np.inf
1293037
public static BigFloat cot(BigFloat x) {
		if(x.isSpecial())
			return x;
		if(x.isZero())
			return POSITIVE_INFINITY;
		return x.context.valueOf(BigDecimalMath.cot(x.value, x.context.mathContext));
	}
1334554
function(value,i){
            i= Math.pow(10, i || 15);
            // default
            return Math.round(value*i)/i;
        }
5288
def floor(self):
    """"""
    return Point(int(math.floor(self.x)), int(math.floor(self.y)))
689101
def round_if_near_integer(a, epsilon=1e-4):
    
    if abs(a - round(a)) <= epsilon:
        return round(a)
    else:
        return a
659355
function round (amount, numOfDecDigits) {
        numOfDecDigits = numOfDecDigits || 2;
        return Math.round(amount * Math.pow(10, numOfDecDigits)) / Math.pow(10, numOfDecDigits);
    }
470981
def in_lamp_reach(p):
    '''  '''
    v1 = XYPoint(Lime.x - Red.x, Lime.y - Red.y)
    v2 = XYPoint(Blue.x - Red.x, Blue.y - Red.y)

    q = XYPoint(p.x - Red.x, p.y - Red.y)
    s = cross_product(q, v2) / cross_product(v1, v2)
    t = cross_product(v1, q) / cross_product(v1, v2)

    return (s >= 0.0) and (t >= 0.0) and (s + t <= 1.0)
519225
public static double rint(double x) {
        double y = floor(x);
        double d = x - y;

        if (d > 0.5) {
            if (y == -1.0) {
                return -0.0; // Preserve sign of operand
            }
            return y+1.0;
        }
        if (d < 0.5) {
            return y;
        }

        /* half way, round to even */
        long z = (long) y;
        return (z & 1) == 0 ? y : y + 1.0;
    }
754603
public void calculateFuzzySpace() {
		double start = getFrom().doubleValue();
		double stop = getTo().doubleValue();
		double step = getStep().doubleValue();

		// enumerate the variable range
		members().forEach(member -> {
			if (member.haveFunctionCall()) {
				for (double i = start; i <= stop; i += step) {
					member.calculateFunctionAt(i);
				}
			} else {
				member.calculateEndPoints(start, stop);
				for (double i = start; i <= stop; i += step) {
					member.calculateValueAt(i);
				}
			}
		});

		// find the max over all members
		double yMax = Double.MIN_VALUE;
		for (Member member : members()) {
			double memberMax = member.findMax();
			yMax = memberMax > yMax ? memberMax : yMax;
		}

		// normalize exploded values into a byte range
		for (Member member : members()) {
			member.normalizeY(yMax, 255);
			totalSteps = Math.max(totalSteps, member.normalized().size());
		}

		this.calculated = true;
	}
1290341
function roundRat (f) {
  var a = f[0]
  var b = f[1]
  if (a.cmpn(0) === 0) {
    return 0
  }
  var h = a.abs().divmod(b.abs())
  var iv = h.div
  var x = bn2num(iv)
  var ir = h.mod
  var sgn = (a.negative !== b.negative) ? -1 : 1
  if (ir.cmpn(0) === 0) {
    return sgn * x
  }
  if (x) {
    var s = ctz(x) + 4
    var y = bn2num(ir.ushln(s).divRound(b))
    return sgn * (x + y * Math.pow(2, -s))
  } else {
    var ybits = b.bitLength() - ir.bitLength() + 53
    var y = bn2num(ir.ushln(ybits).divRound(b))
    if (ybits < 1023) {
      return sgn * y * Math.pow(2, -ybits)
    }
    y *= Math.pow(2, -1023)
    return sgn * y * Math.pow(2, 1023 - ybits)
  }
}
121059
def _recursive_round(self, value, precision):
        
        if hasattr(value, '__iter__'):
            return tuple(self._recursive_round(v, precision) for v in value)
        return round(value, precision)
1205467
def _round_frac(x, precision):
    
    if not np.isfinite(x) or x == 0:
        return x
    else:
        frac, whole = np.modf(x)
        if whole == 0:
            digits = -int(np.floor(np.log10(abs(frac)))) - 1 + precision
        else:
            digits = precision
        return np.around(x, digits)