@jiminp/tooltool
    Preparing search index...

    Function ceilDiv

    • Computes the ceiling of the division n / d for both number and bigint inputs.

      Parameters

      • n: number

        The dividend (numerator).

      • d: number

        The divisor (denominator). Must not be zero.

      Returns number

      The smallest integer that is greater than or equal to n / d.

      When using number arguments, both values must be safe integers so that the computation stays exact.

      When d is zero.

      When arguments are not both safe integers, not both bigint, or are of different primitive numeric types.

      ceilDiv(7, 3);    // => 3
      ceilDiv(-7n, 3n); // => -2n
    • Computes the ceiling of the division n / d for both number and bigint inputs.

      Parameters

      • n: bigint

        The dividend (numerator).

      • d: bigint

        The divisor (denominator). Must not be zero.

      Returns bigint

      The smallest integer that is greater than or equal to n / d.

      When using number arguments, both values must be safe integers so that the computation stays exact.

      When d is zero.

      When arguments are not both safe integers, not both bigint, or are of different primitive numeric types.

      ceilDiv(7, 3);    // => 3
      ceilDiv(-7n, 3n); // => -2n