Mojo function
ceildiv[T: CeilDivable, //](numerator: T, denominator: T) -> T
Return the rounded-up result of dividing numerator by denominator.
Parameters:
- T (
CeilDivable): A type that support floor division.
Args:
- numerator (
T): The numerator. - denominator (
T): The denominator.
Returns:
T: The ceiling of dividing numerator by denominator.
ceildiv[T: CeilDivableRaising, //](numerator: T, denominator: T) -> T
Return the rounded-up result of dividing numerator by denominator, potentially raising.
Parameters:
- T (
CeilDivableRaising): A type that support floor division.
Args:
- numerator (
T): The numerator. - denominator (
T): The denominator.
Returns:
T: The ceiling of dividing numerator by denominator.
Raises:
If the operation fails.
ceildiv(numerator: IntLiteral[numerator.value], denominator: IntLiteral[denominator.value]) -> IntLiteral[(0 - (numerator.value // (0 - denominator.value)))]
Return the rounded-up result of dividing numerator by denominator.
Args:
- numerator (
IntLiteral): The numerator. - denominator (
IntLiteral): The denominator.
Returns:
IntLiteral: The ceiling of dividing numerator by denominator.