Table Of Contents

round

Version:
    Last Modified: January 9, 2017

    Rounds the input elements to the nearest integer value.

    Syntax

    c = round(a)

    Inputs

    a

    Numeric scalar or numeric array of any dimension.

    Outputs

    c

    Elements of a rounded to the nearest integer value. c is an array of the same size as a.

    Rounding Rules

    If the fractional component of an element in a is 0.5, MathScript rounds up.

    Complex Values

    If a is complex, MathScript computes the nearest integer values with the following equation: c = round(real(a))+round(imag(a))*i.

    A = [-3.7, -2.5, -1.5, -1.2, 1.3, 2.5, 3.7]
    C = round(A)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: Not supported


    Recently Viewed Topics