/*[deutsch]
<p>Siehe {@link #floorModulo(int, int)}. </p>

@param   value       numerator
@param   divisor     divisor
@return  remainder of division (never negative if divisor is positive)
10604
public static int floorModulo(
        long value,
        int divisor
    ) {

        long ret = (value - divisor * (floorDivide(value, divisor)));
        return (int) ret; // Type-Cast hier wegen modulo-Semantik sicher

    }
588756
public function mod($dividend, $divisor)
    {
        if ($divisor === 0) {
            return 0;
        }

        $modulus = $dividend % $divisor;
        if ($modulus < 0) {
            $modulus += $divisor;
        }

        return $modulus;
    }
925291
public function remainder($that) : BigInteger
    {
        $that = BigInteger::of($that);

        if ($that->value === '0') {
            throw DivisionByZeroException::divisionByZero();
        }

        $remainder = Calculator::get()->divR($this->value, $that->value);

        return new BigInteger($remainder);
    }
371455
public function mod($divisor, $remainder = 0) : self
    {
        $this->expr->mod($divisor, $remainder);
        return $this;
    }
1331105
public function divide($divisor, $roundingMode = self::ROUND_HALF_UP, $precision = self::PRECISION_GAAP)
    {
        $this->assertRoundingMode($roundingMode);
        $divisor = $this->castOperand($divisor);
        $precision = $this->castPrecision($precision);

        $innerPrecision = $this->getInnerPrecision();
        if ($divisor->isZero($innerPrecision)) {
            throw new Exception\InvalidArgumentException('Division by zero');
        }

        $amount = $this->amount->div($divisor, $innerPrecision + 1);

        if (null === $roundingMode) {
            $amount = $amount->round($precision);
        } else {
            $amount = Math::bcround($amount, $precision, $roundingMode);
        }

        return $this->newInstance($amount);
    }
1105165
public function divide($divisor, $roundingMode = self::ROUND_HALF_UP)
    {
        $this->assertOperand($divisor);
        $this->assertRoundingMode($roundingMode);

        if ($divisor == 0) {
            throw new InvalidArgumentException('Division by zero');
        }

        return new self(round($this->amount / $divisor, $this->currency->getPrecision(), $roundingMode), $this->currency);
    }
1306291
private static long floorDiv(long x, long y) {
    return BigDecimal.valueOf(x).divide(BigDecimal.valueOf(y), 0, RoundingMode.FLOOR).longValue();
  }
560908
function(divident, divisor) {
    var quotient = [],
        shift = 0;
    
    // do not modify original number
    divisor = divisor.slice(); 
    divident = divident.slice();

    while (divisor.length < divident.length) {
        divisor.unshift(0);
        shift += 1;
    }

    for (; shift >= 0; shift -= 1) {
        if (comparePositive(divident, divisor) >= 0) {
            divident = subtractPositive(divident, divisor);
            divident = normalize(divident);

            quotient.unshift(1);
        }
        else {
            quotient.unshift(0);
        }

        divisor.shift();
    }

    return [quotient, divident];
}
419778
@CheckReturnValue
  public UnsignedInteger dividedBy(UnsignedInteger val) {
    return fromIntBits(UnsignedInts.divide(value, checkNotNull(val).value));
  }
615637
public static FractionNumber createMaxDenominator(final double value, int maxDenom, boolean wholeType) {
        final FractionNumber fractionNumber = new FractionNumber(value);
        fractionNumber.wholeType = wholeType;
        
        final SimpleFraction fraction = SimpleFraction.createFractionMaxDenominator(Math.abs(value), maxDenom);
        setupFractionPart(fraction, fractionNumber);
        
        return fractionNumber;
    }
30314
public static void divide( GrayU8 input , double denominator , GrayU8 output ) {

		output.reshape(input.width,input.height);

		int columns = input.width;
		if(BoofConcurrency.USE_CONCURRENT ) {
			ImplPixelMath_MT.divideU_A(input.data,input.startIndex,input.stride,denominator , 
					output.data,output.startIndex,output.stride,
					input.height,columns);
		} else {
			ImplPixelMath.divideU_A(input.data,input.startIndex,input.stride,denominator , 
					output.data,output.startIndex,output.stride,
					input.height,columns);
		}
	}
748768
def divide_ceiling(numerator, denominator):
    
    split_val = numerator // denominator
    rest = numerator % denominator

    if rest > 0:
        return split_val + 1
    else:
        return split_val
656758
public static int round( int top , int div2 , int divisor ) {
		if( top > 0 )
			return (top + div2)/divisor;
		else
			return (top - div2)/divisor;
	}
1362427
static int mod(int dividend, int divisor) {
        int result = dividend % divisor;
        return result >= 0 ? result : divisor + result;
    }
687508
public function asMultiplied($value, $divisor, $decimals = null)
    {
        if ($value === null) {
            return $this->nullDisplay;
        }
        return $this->asDecimal($this->normalizeNumericValue($value) / (double)$divisor, $decimals);
    }
1016014
protected function formatValue($value, $divisor)
    {
        $quotient = 0;
        if ($divisor > 0 && $value > 0) {
            $quotient = round($value / $divisor, $this->quotientPrecision);
        }

        return $quotient;
    }
1146346
@Override
    public FastMoney divide(Number divisor) {
        if (isInfinityAndNotNaN(divisor)) {
            return new FastMoney(0L, getCurrency());
        }
        checkNumber(divisor);
        if (isOne(divisor)) {
            return this;
        }
        return new FastMoney(Math.round(this.number / divisor.doubleValue()), getCurrency());
    }