.ModelicaReference.Operators.'mod()'

Information

Integer modulus of a division of two Real numbers

Syntax

mod(x, y)

Description

Returns the integer modulus of x/y, i.e., mod(x, y) = x - floor(x/y)*y. Result and arguments shall have type Real or Integer. If either of the arguments is Real the result is Real otherwise Integer. [Note, outside of a when clause state events are triggered when the return value changes discontinuously.]

Examples

mod(3,1.4)
 = 0.2
mod(-3,1.4)
 = 1.2
mod(3,-1.4)
 = -1.2

Generated at 2024-04-18T18:15:58Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos