Calculates the floor of a rational number

Ex: new Fraction('4.(3)').floor() => (4 / 1)
185314
function(places) {

      places = Math.pow(10, places || 0);

      if (isNaN(this["n"]) || isNaN(this["d"])) {
        return new Fraction(NaN);
      }
      return new Fraction(Math.floor(places * this["s"] * this["n"] / this["d"]), places);
    }
1323023
public static double trunc(Double number) {
        if (number < 0d) {
            return Math.ceil(number);
        }
        return Math.floor(number);
    }
1066532
function( v ) {
			v = +v;
			if ( isNaN( v ) ) return +0;
			if ( v === 0 || !isFinite( v ) ) return v;
			return ( v < 0 ? -1 : 1 ) * abs( floor( v ) );
		}
1115510
def round_to_n(x, n):
    
    return round(x, -int(np.floor(np.log10(x))) + (n - 1))
1025100
function (value, from) {
    var len = this.length >>> 0;

    from = Number(from) || 0;
    from = Math[from < 0 ? 'ceil' : 'floor'](from);

    if (from < 0) {
      from = Math.max(from + len, 0);
    }

    for (; from < len; from++) {
      if (from in this && this[from] === value) {
        return from;
      }
    }

    return -1;
  }
1192619
function(places) {

      places = 10 ** Number(places || 0);

      return new Fraction(Math.ceil(places * Number(this["s"] * this["n"]) / Number(this["d"])), places);
    }
287608
function(match, step) {
				var matches = 1;
				while (iFormat + matches < format.length && format.charAt(iFormat + matches) === match) {
					matches++;
				}
				iFormat += matches - 1;
				return Math.floor(matches / (step || 1)) > 1;
			}
569208
def teachers_round(x):
    '''
    
    '''
    if ((x > 0) and (x % 1 >= 0.5)) or ((x < 0) and (x % 1 > 0.5)):
        return int(np.ceil(x))
    else:
        return int(np.floor(x))
991416
function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {
    var digits = parsedNumber.d;
    var fractionLen = digits.length - parsedNumber.i;

    // determine fractionSize if it is not specified; `+fractionSize` converts it to a number
    fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;

    // The index of the digit to where rounding is to occur
    var roundAt = fractionSize + parsedNumber.i;
    var digit = digits[roundAt];

    if (roundAt > 0) {
      // Drop fractional digits beyond `roundAt`
      digits.splice(Math.max(parsedNumber.i, roundAt));

      // Set non-fractional digits beyond `roundAt` to 0
      for (var j = roundAt; j < digits.length; j++) {
        digits[j] = 0;
      }
    } else {
      // We rounded to zero so reset the parsedNumber
      fractionLen = Math.max(0, fractionLen);
      parsedNumber.i = 1;
      digits.length = Math.max(1, roundAt = fractionSize + 1);
      digits[0] = 0;
      for (var i = 1; i < roundAt; i++) digits[i] = 0;
    }

    if (digit >= 5) {
      if (roundAt - 1 < 0) {
        for (var k = 0; k > roundAt; k--) {
          digits.unshift(0);
          parsedNumber.i++;
        }
        digits.unshift(1);
        parsedNumber.i++;
      } else {
        digits[roundAt - 1]++;
      }
    }

    // Pad out with zeros to get the required fraction length
    for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);


    // Do any carrying, e.g. a digit was rounded up to 10
    var carry = digits.reduceRight(function(carry, d, i, digits) {
      d = d + carry;
      digits[i] = d % 10;
      return Math.floor(d / 10);
    }, 0);
    if (carry) {
      digits.unshift(carry);
      parsedNumber.i++;
    }
}
102945
def floor_nearest(x, dx=1):
    
    precision = get_sig_digits(dx)
    return round(math.floor(float(x) / dx) * dx, precision)
876931
function(x, y) {
    x = Math.floor(x);
    y = Math.floor(y);

    if (x < 0 || x > this.size - 1 || y < 0 || y > this.size - 1) {
      return -1;
    }

    return this.grid[y * this.size + x];
  }
5288
def floor(self):
    """"""
    return Point(int(math.floor(self.x)), int(math.floor(self.y)))
994087
public static Double floor(Double a) {
		return a==null ? null : Math.floor(a);
	}
294622
function divide(buf, n) {
  /* eslint-disable no-bitwise */
  var i = 0, l, t, rem;

  t = buf[i];
  rem = t % n;
  buf[i] = Math.floor(t / n);

  for (i = 1, l = buf.length; i < l; i++) {
    t = rem * 256 + buf[i];
    rem = t % n;
    buf[i] = Math.floor(t / n);
  }

  return rem;
}
664776
@Override
	public RandomVariable floor(double floor) {
		return apply(new DoubleUnaryOperator() {
			@Override
			public double applyAsDouble(double x) {
				return Math.max(x, floor);
			}
		});
	}
440678
public Rational at(int n) {
        if (n == 1) {
            return (new Rational(-1, 2));
        } else if (n % 2 != 0) {
            return Rational.ZERO;
        } else {
            final int nindx = n / 2;
            if (a.size() <= nindx) {
                for (int i = 2 * a.size(); i <= n; i += 2) {
                    set(i, doubleSum(i));
                }
            }
            return a.get(nindx);
        }
    }
1284420
private int calculateTileLevel() {
		double baseX = layerBounds.getWidth();
		double baseY = layerBounds.getHeight();
		// choose the tile level so the area is between minimumTileSize and the next level (minimumTileSize * 4)
		double baseArea = baseX * baseY;
		double scale = layer.getMapModel().getMapView().getCurrentScale();
		double osmArea = preferredTileSize / (scale * scale);
		int tileLevel = (int) Math.round(Math.log(baseArea / osmArea) / Math.log(4.0));
		if (tileLevel < 0) {
			tileLevel = 0;
		}
		return tileLevel;
	}