Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

remainder

remainder( 
x_integer1 
x_integer2 
) 
=> x_integer

Description

Returns the remainder of dividing two integers. The remainder is either zero or has the sign of the dividend. Same as mod.

The remainder and modulo functions differ on negative arguments. The remainder is either zero or has the sign of the dividend if you use the remainder function. With modulo the return value always has the sign of the divisor.

Arguments

x_integer1

Dividend.

x_integer2

Divisor.

Value Returned

x_integer

Remainder of dividing x_integer1 by x_integer2. The sign is determined by the sign of x_integer1.

Examples

modulo( 13 4)            
=> 1
remainder( 13 4)
=> 1
modulo( -13 4)           
=> 3
remainder( -13 4)
=> -1
modulo( 13 -4)           
=> -3
remainder( 13 -4)
=> 1
modulo( -13 -4)          
=> -1
remainder( -13 -4)
=> -1

Related Topics

modulo


Return to top
 ⠀
X