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

mod (MathScript RT Module Function)

LabVIEW 2011 MathScript RT Module Help

Edition Date: June 2011

Part Number: 373123B-01

»View Product Info

Owning Class: basic

Requires: MathScript RT Module

Syntax

c = mod(a, b)

Description

Computes the modulo of the input elements.

Details

Examples

Inputs

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.

Outputs

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.

Details

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

Examples

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

Related Topics

rem


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit