Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

mod (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: basic

Requires: MathScript RT Module


c = mod(a, b)


Computes the modulo of the input elements.




Name Description
a Specifies the dividend. a is a scalar, vector, or matrix of real numbers.
b Specifies the divisor. b is a scalar, vector, or matrix of real numbers.


Name Description
c Returns the modulo of a and b. c has the same sign as b. c is a matrix of the same size as the larger of a and b.


LabVIEW computes the modulo using the following equation: mod(a, b) = a-b.*floor(a./b). If b is 1 and a is positive, mod(a, 1) is the fractional part of a. If the input elements have the same sign, mod(a, b) is equivalent to rem(a, b).

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Yes


A = [1:1:5]
B = 3
C = mod(A, B)

Related Topics



 Was this document helpful?  submit
  Helpful Not Helpful