ts-data-forge
    Preparing search index...

    Function roundToInt

    • Rounds a number to the nearest integer using bitwise operations.

      This function uses a bitwise OR trick for potentially faster rounding. Note: This implementation rounds half up for positive numbers but may behave differently for negative numbers compared to Math.round.

      Parameters

      • num: number

        The number to round

      Returns Int

      The rounded integer as an Int branded type