Table Of Contents


    Last Modified: December 12, 2016

    Computes the remainder of the input elements.


    c = rem(a, b)



    Dividend. a is a non-complex scalar or array of any dimension. If b is an array, a can be a scalar.


    Divisor. b is a non-complex scalar or non-complex array of the same dimension as a. If a is an array, b can be a scalar.



    Remainder of a divided by b. c has the same sign as a. c is an array of the same as the larger of a and b. The output data type is the smaller data type of the two inputs. For example, if one input is double precision and the other input is single precision floating point number, the output is a single precision floating point number.

    Calculation Formula

    The remainder is computed using the following equation: rem(a, b) = a-fix(a./b).*b.

    Input Types

    If the input elements have the same sign, rem(a, b) is equivalent to mod(a, b). If one input is an integer type, the other must be the same integer type or a double scalar type.

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

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: DAQExpress does not support FPGA devices

    Recently Viewed Topics