Mojo function
ceildiv
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:
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:
The ceiling of dividing numerator by denominator.
ceildiv(numerator: IntLiteral, denominator: IntLiteral) -> IntLiteral
Return the rounded-up result of dividing numerator by denominator.
Args:
- numerator (
IntLiteral
): The numerator. - denominator (
IntLiteral
): The denominator.
Returns:
The ceiling of dividing numerator by denominator.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!