Scalar function
NULL input returns NULL.
Syntax
Scalar
- This page describes the signed-integer calling form with a nonzero divisor. Equal integer types are preserved. With different signed integer types, both operands convert to the wider type in this order: TINYINT, SMALLINT, INTEGER, BIGINT.
Arguments
Returns
- Type: TINYINT, SMALLINT, INTEGER or BIGINT: the wider signed integer input type
- NULL behavior: NULL input returns NULL.
Properties
Usage notes
- Operands are converted to a common numeric type before calculating the remainder.
- Equal integer types are preserved. With different signed integer types, both operands convert to the wider type in this order: TINYINT, SMALLINT, INTEGER, BIGINT.
- Query tools report the divisor’s type, which can be narrower than the actual result type.
- Deterministic: The same inputs and settings produce the same result.
Examples
Typical behavior
Different dividend and divisor signs
Limitations
- Use compatible integer inputs and a nonzero divisor.
Last modified on October 15, 2026